Fix tweet stat parsing

This commit is contained in:
Zed 2019-06-26 20:06:20 +02:00
parent 7d2fa15676
commit d052ff538c
1 changed files with 4 additions and 4 deletions

View File

@ -125,10 +125,10 @@ proc getTweetStats*(tweet: Tweet; node: XmlNode) =
tweet.likes = "0" tweet.likes = "0"
for action in node.selectAll(".ProfileTweet-actionCountForAria"): for action in node.selectAll(".ProfileTweet-actionCountForAria"):
let text = action.innerText.split() let text = action.innerText.split()
case text[1] case text[1][0 .. 2]
of "replies": tweet.replies = text[0] of "ret": tweet.retweets = text[0]
of "likes": tweet.likes = text[0] of "rep": tweet.replies = text[0]
of "retweets": tweet.retweets = text[0] of "lik": tweet.likes = text[0]
proc getGif(player: XmlNode): Gif = proc getGif(player: XmlNode): Gif =
let let