Support tweet locations

This commit is contained in:
Zed
2019-12-21 05:44:58 +01:00
parent 80d6191e74
commit f8f4487c33
7 changed files with 34 additions and 5 deletions

View File

@@ -285,3 +285,9 @@ proc getMediaTags*(node: XmlNode): seq[Profile] =
let un = user["screen_name"].getStr
if un notin usernames: continue
result.add Profile(username: un, fullname: user["name"].getStr)
proc getTweetLocation*(node: XmlNode): string =
let geo = node.select(".js-geo-pivot-link")
if geo == nil: return
result = geo.innerText().stripText()
result &= ":" & geo.attr("data-place-id")