Add photo rail support

This commit is contained in:
Zed
2019-07-04 04:18:32 +02:00
parent 080d4774cf
commit 141bfdc508
8 changed files with 103 additions and 5 deletions

View File

@@ -163,3 +163,11 @@ proc parsePoll*(node: XmlNode): Poll =
if n > highest:
highest = n
result.leader = i
proc parsePhotoRail*(node: XmlNode): seq[GalleryPhoto] =
for img in node.selectAll(".tweet-media-img-placeholder"):
result.add GalleryPhoto(
url: img.attr("data-image-url"),
tweetId: img.attr("data-tweet-id"),
color: img.attr("background-color").replace("style", "background-color")
)