mirror of
https://github.com/zedeus/nitter
synced 2026-09-06 15:19:32 +00:00
Fix parsing censored tweets
This commit is contained in:
parent
509e1dc5e8
commit
2d7e12fcb8
2 changed files with 17 additions and 5 deletions
|
|
@ -55,6 +55,18 @@ proc getId*(js: JsonNode): int64 {.inline.} =
|
|||
of JInt: return js.getBiggestInt()
|
||||
else: return 0
|
||||
|
||||
proc getEntryId*(js: JsonNode): string {.inline.} =
|
||||
let entry = js{"entryId"}.getStr
|
||||
if entry.len == 0: return
|
||||
|
||||
if "tweet" in entry:
|
||||
return entry.getId
|
||||
elif "tombstone" in entry:
|
||||
return js{"content", "item", "content", "tombstone", "tweet", "id"}.getStr
|
||||
else:
|
||||
echo "unknown entry: ", entry
|
||||
return
|
||||
|
||||
template getStrVal*(js: JsonNode; default=""): string =
|
||||
js{"string_value"}.getStr(default)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue