Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes AttributeError: TweetParser object has no attribute key_data #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions download_tweets.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ def retrieve_all_likes(self):
for raw_tweet in likes_page:
try:
tweet_parser = TweetParser(raw_tweet)
if self.tweet_stop_id and tweet_parser.tweet_id == str(self.tweet_stop_id):
stop = True
break
if tweet_parser.is_valid_tweet:
all_tweets.append(tweet_parser.tweet_as_json())
if self.tweet_stop_id and tweet_parser.tweet_id == str(self.tweet_stop_id):
stop = True
break
else:
all_tweets.append(tweet_parser.tweet_as_json())
except KeyError:
# TODO: We should have an option to dump such tweet structures.
pass # Ignore tweets that are not of interest to us.
Expand Down