mirror of
https://github.com/zedeus/nitter.git
synced 2024-12-14 03:56:29 +00:00
Fix user search parser
This commit is contained in:
parent
a7f585feaa
commit
6695784050
1 changed files with 13 additions and 11 deletions
|
@ -15,14 +15,16 @@ proc parseUsers*(json: string; after=""): Result[User] =
|
||||||
if raw.timeline.instructions.len == 0:
|
if raw.timeline.instructions.len == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
for e in raw.timeline.instructions[0].addEntries.entries:
|
for i in raw.timeline.instructions:
|
||||||
let id = e.entryId.getId
|
if i.addEntries.entries.len > 0:
|
||||||
if e.entryId.startsWith("user"):
|
for e in i.addEntries.entries:
|
||||||
if id in raw.globalObjects.users:
|
let id = e.entryId.getId
|
||||||
result.content.add toUser raw.globalObjects.users[id]
|
if e.entryId.startsWith("user"):
|
||||||
elif e.entryId.startsWith("cursor"):
|
if id in raw.globalObjects.users:
|
||||||
let cursor = e.content.operation.cursor
|
result.content.add toUser raw.globalObjects.users[id]
|
||||||
if cursor.cursorType == "Top":
|
elif e.entryId.startsWith("cursor"):
|
||||||
result.top = cursor.value
|
let cursor = e.content.operation.cursor
|
||||||
elif cursor.cursorType == "Bottom":
|
if cursor.cursorType == "Top":
|
||||||
result.bottom = cursor.value
|
result.top = cursor.value
|
||||||
|
elif cursor.cursorType == "Bottom":
|
||||||
|
result.bottom = cursor.value
|
||||||
|
|
Loading…
Reference in a new issue