From 557ef6deb9c74298e7044f11d7a605f11c456ff5 Mon Sep 17 00:00:00 2001 From: jeancf Date: Thu, 17 Dec 2020 17:50:10 +0100 Subject: [PATCH] Handling reply-to --- twoot.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/twoot.py b/twoot.py index ee418c9..294ea21 100755 --- a/twoot.py +++ b/twoot.py @@ -222,6 +222,10 @@ def main(argv): ) url = 'https://nitter.net/' + twit_account + # Use different page if we need to handle replies + if tweets_and_replies: + url += '/with_replies' + # Download twitter page of user. twit_account_page = session.get(url, headers=headers) @@ -248,7 +252,7 @@ def main(argv): # Extract twitter timeline timeline = soup.find_all('div', class_='timeline-item') - logging.info('Processing ' + len(timeline) + ' tweets found in timeline') + logging.info('Processing ' + str(len(timeline)) + ' tweets found in timeline') # ********************************************************** # Process each tweets and generate dictionary @@ -292,6 +296,8 @@ def main(argv): full_status_url = 'https://twitter.com' + tweet_id # TODO Check if the tweet is a reply-to + #
Replying to @tomwarren
+ being_replied_to = status.find('div', class_='replying-to').a.get_text() # Check it the tweet is a retweet from somebody else if author_account.lower() != twit_account.lower():