fix tweet cursor

This commit is contained in:
Cynthia Foxwell 2025-06-07 17:16:18 -06:00
parent c3bcf30826
commit cef5429cdc
No known key found for this signature in database
2 changed files with 8 additions and 2 deletions

View File

@ -588,7 +588,7 @@ proc parseGraphConversation*(js: JsonNode; tweetId: string): Conversation =
else: else:
result.replies.content.add thread result.replies.content.add thread
elif entryId.startsWith("cursor-bottom"): 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 = proc parseGraphTimeline*(js: JsonNode; root: string; after=""): Profile =
result = Profile(tweets: Timeline(beginning: after.len == 0)) result = Profile(tweets: Timeline(beginning: after.len == 0))

View File

@ -48,7 +48,13 @@ template with*(ident; value: JsonNode; body): untyped =
if notNull(value): body if notNull(value): body
template getCursor*(js: JsonNode): string = 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 = template getError*(js: JsonNode): Error =
if js.kind != JArray or js.len == 0: null if js.kind != JArray or js.len == 0: null