Explorar o código

Fix tweet stat parsing

Zed %!s(int64=7) %!d(string=hai) anos
pai
achega
d052ff538c
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      src/parserutils.nim

+ 4 - 4
src/parserutils.nim

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