Add bookmark_count and view_count to the X / Twitter extractor
- Parse `view_count` as integer in Twitter extractor - Style fix - optimize 'view_count' extraction
This commit is contained in:
@@ -321,8 +321,17 @@ class TwitterExtractor(Extractor):
|
||||
"quote_count" : tget("quote_count"),
|
||||
"reply_count" : tget("reply_count"),
|
||||
"retweet_count" : tget("retweet_count"),
|
||||
"bookmark_count": tget("bookmark_count"),
|
||||
}
|
||||
|
||||
if "views" in tweet:
|
||||
try:
|
||||
tdata["view_count"] = int(tweet["views"]["count"])
|
||||
except Exception:
|
||||
tdata["view_count"] = 0
|
||||
else:
|
||||
tdata["view_count"] = 0
|
||||
|
||||
if "note_tweet" in tweet:
|
||||
note = tweet["note_tweet"]["note_tweet_results"]["result"]
|
||||
content = note["text"]
|
||||
|
||||
Reference in New Issue
Block a user