mirror of https://github.com/zedeus/nitter
Only strip quote links
This commit is contained in:
parent
e07a8d04b4
commit
e920e98d10
|
@ -39,11 +39,13 @@ proc getUsername*(profile: XmlNode; selector: string): string =
|
|||
profile.selectText(selector).strip(chars={'@', ' '})
|
||||
|
||||
proc getTweetText*(tweet: XmlNode): string =
|
||||
let selector = ".tweet-text > a.twitter-timeline-link.u-hidden"
|
||||
let link = tweet.selectAttr(selector, "data-expanded-url")
|
||||
var text = tweet.selectText(".tweet-text")
|
||||
let
|
||||
selector = ".tweet-text > a.twitter-timeline-link.u-hidden"
|
||||
link = tweet.selectAttr(selector, "data-expanded-url")
|
||||
quote = tweet.querySelector(".QuoteTweet")
|
||||
|
||||
if link.len > 0 and link in text:
|
||||
if not quote.isNil and link.len > 0:
|
||||
text = text.replace(link, "")
|
||||
|
||||
stripTwitterUrls(text)
|
||||
|
|
Loading…
Reference in New Issue