mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
Add experimental GraphQL user parser
This commit is contained in:
parent
535f6936b9
commit
ae7091e69d
6 changed files with 49 additions and 34 deletions
|
|
@ -26,16 +26,6 @@ proc parseUser(js: JsonNode; id=""): User =
|
|||
|
||||
result.expandUserEntities(js)
|
||||
|
||||
proc parseGraphUser*(js: JsonNode; id: string): User =
|
||||
if js.isNull: return
|
||||
|
||||
with user, js{"data", "user", "result", "legacy"}:
|
||||
result = parseUser(user, id)
|
||||
|
||||
with pinned, user{"pinned_tweet_ids_str"}:
|
||||
if pinned.kind == JArray and pinned.len > 0:
|
||||
result.pinnedTweet = parseBiggestInt(pinned[0].getStr)
|
||||
|
||||
proc parseGraphList*(js: JsonNode): List =
|
||||
if js.isNull: return
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue