Only strip quote links
This commit is contained in:
parent
e07a8d04b4
commit
e920e98d10
1 changed files with 5 additions and 3 deletions
|
@ -39,11 +39,13 @@ proc getUsername*(profile: XmlNode; selector: string): string =
|
||||||
profile.selectText(selector).strip(chars={'@', ' '})
|
profile.selectText(selector).strip(chars={'@', ' '})
|
||||||
|
|
||||||
proc getTweetText*(tweet: XmlNode): string =
|
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")
|
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, "")
|
text = text.replace(link, "")
|
||||||
|
|
||||||
stripTwitterUrls(text)
|
stripTwitterUrls(text)
|
||||||
|
|
Loading…
Reference in a new issue