Add clicking on MenuItem to open Twitch page
This commit is contained in:
@@ -39,14 +39,16 @@ class MatchesAPI {
|
||||
|
||||
var matches = [Match]()
|
||||
for match in matchString {
|
||||
|
||||
let score = try match.getElementsByClass("versus").text()
|
||||
let split = score.split(separator: ":")
|
||||
let leftscore = String(split[0])
|
||||
let rightscore = String(split[1])
|
||||
|
||||
|
||||
let newMatch = Match()
|
||||
newMatch.ongoing = true
|
||||
newMatch.streamLink = "https://twitch.tv" + (match.getAttributes()?.get(key: "data-stream-twitch"))!
|
||||
// TODO: Handle what happens when there is no twitch page. Currently it just opens Twicht main page.
|
||||
newMatch.streamLink = try "https://twitch.tv/" + match.getElementsByClass("timer-object").attr("data-stream-twitch")
|
||||
newMatch.league = try match.select("tr > td > div > div > a").text()
|
||||
newMatch.team1name = try match.getElementsByClass("team-left").text()
|
||||
newMatch.team1score = leftscore
|
||||
|
||||
Reference in New Issue
Block a user