Skip to content

Commit 94c83f3

Browse files
committed
Hide ads/promoted tweets
Fixes zedeus#1234
1 parent 83b0f8b commit 94c83f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/parser.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ proc parseGraphThread(js: JsonNode): tuple[thread: Chain; self: bool] =
336336
let cursor = t{"item", "content", "value"}
337337
result.thread.cursor = cursor.getStr
338338
result.thread.hasMore = true
339-
elif "tweet" in entryId:
339+
elif "tweet" in entryId and "promoted" notin entryId:
340340
let
341341
isLegacy = t{"item"}.hasKey("itemContent")
342342
(contentKey, resultKey) = if isLegacy: ("itemContent", "tweet_results")
@@ -381,7 +381,7 @@ proc parseGraphConversation*(js: JsonNode; tweetId: string; v2=true): Conversati
381381
let (thread, self) = parseGraphThread(e)
382382
if self:
383383
result.after = thread
384-
else:
384+
elif thread.content.len > 0:
385385
result.replies.content.add thread
386386
elif entryId.startsWith("tombstone"):
387387
let id = entryId.getId()

0 commit comments

Comments
 (0)