fix tweet cursor
This commit is contained in:
parent
c3bcf30826
commit
cef5429cdc
@ -588,7 +588,7 @@ proc parseGraphConversation*(js: JsonNode; tweetId: string): Conversation =
|
||||
else:
|
||||
result.replies.content.add thread
|
||||
elif entryId.startsWith("cursor-bottom"):
|
||||
result.replies.bottom = e{"content", "value"}.getStr
|
||||
result.replies.bottom = e.getCursor
|
||||
|
||||
proc parseGraphTimeline*(js: JsonNode; root: string; after=""): Profile =
|
||||
result = Profile(tweets: Timeline(beginning: after.len == 0))
|
||||
|
||||
@ -48,7 +48,13 @@ template with*(ident; value: JsonNode; body): untyped =
|
||||
if notNull(value): body
|
||||
|
||||
template getCursor*(js: JsonNode): string =
|
||||
js{"content", "operation", "cursor", "value"}.getStr
|
||||
var cursor = js{"content", "operation", "cursor", "value"}
|
||||
if cursor.isNull:
|
||||
cursor = js{"content", "value"}
|
||||
if cursor.isNull:
|
||||
cursor = js{"content", "itemContent", "value"}
|
||||
|
||||
cursor.getStr
|
||||
|
||||
template getError*(js: JsonNode): Error =
|
||||
if js.kind != JArray or js.len == 0: null
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user