Skip to content

Commit

Permalink
Fixing issue when quoted tweet is not present in payload
Browse files Browse the repository at this point in the history
  • Loading branch information
Yomguithereal committed Feb 3, 2021
1 parent 47e4462 commit 56201f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions minet/twitter/api_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,15 @@ def process_single_tweet(tweet_id, tweet_index, user_index):
# Quoted?
quoted_id = tweet.get('quoted_status_id_str')

if quoted_id:
# TODO: sometimes tweet is not present
if quoted_id and quoted_id in tweet_index:
tweet['quoted_status'] = process_single_tweet(quoted_id, tweet_index, user_index)

# Retweeted?
retweeted_id = tweet.get('retweeted_status_id_str')

if retweeted_id:
# TODO: sometimes tweet is not present
if retweeted_id and retweeted_id in tweet_index:
tweet['retweeted_status'] = process_single_tweet(retweeted_id, tweet_index, user_index)

return tweet
Expand Down

0 comments on commit 56201f1

Please sign in to comment.