diff --git a/src/parser.nim b/src/parser.nim index 1bcbf5a..32b7b8e 100644 --- a/src/parser.nim +++ b/src/parser.nim @@ -70,6 +70,7 @@ proc parseTweet*(tweet: XmlNode): Tweet = let by = tweet.selectText(".js-retweet-text > a > b") if by.len > 0: result.retweetBy = some(by) + result.retweetId = some(tweet.getAttr("data-retweet-id")) proc parseTweets*(node: XmlNode): Tweets = if node.isNil: return diff --git a/src/types.nim b/src/types.nim index 5af33bf..9cb4c52 100644 --- a/src/types.nim +++ b/src/types.nim @@ -47,6 +47,7 @@ type gif*: Option[string] video*: Option[string] videoThumb*: Option[string] + retweetId*: Option[string] Tweets* = seq[Tweet] diff --git a/src/views/user.nim b/src/views/user.nim index 2c34333..e778f72 100644 --- a/src/views/user.nim +++ b/src/views/user.nim @@ -72,14 +72,15 @@ #var retweets: Tweets #for tweet in tweets: #if tweet in retweets: continue - #end if - #if tweet.retweetBy.isSome: retweets.add tweet + #elif tweet.retweetBy.isSome: retweets.add tweet #end if ${renderTweet(tweet, "timeline-tweet")} #end for #if tweets.len > 0: