Display content attribution

This commit is contained in:
Zed
2019-10-26 16:37:58 +02:00
parent a01265fa48
commit 0b5c15ce67
4 changed files with 35 additions and 1 deletions

View File

@@ -199,6 +199,14 @@ proc getTweetMedia*(tweet: Tweet; node: XmlNode) =
let player = node.select(".PlayableMedia")
if player == nil: return
let attrib = player.select(".PlayableMedia-attribution")
if attrib != nil:
tweet.attribution = some Profile(
username: attrib.attr("href").strip(chars={'/'}),
fullname: attrib.selectText(".fullname"),
userpic: attrib.selectAttr(".avatar", "src")
)
if "gif" in player.attr("class"):
tweet.gif = some getGif(player.select(".PlayableMedia-player"))
elif "video" in player.attr("class"):