Fixed false positive on search for "replying-to"

This commit is contained in:
jeancf 2022-08-22 08:54:17 +02:00
parent c4abee2835
commit 3c847e4f06

View File

@ -414,7 +414,9 @@ def main(argv):
photos = []
# Add prefix if the tweet is a reply-to
replying_to_class = status.find('div', class_='replying-to')
# Only consider item of class 'replying-to' that is a direct child
# of class 'tweet-body' in status. Others can be in a quoted tweet.
replying_to_class = status.select("div.tweet-body > div.replying-to")
if replying_to_class is not None:
tweet_text += 'Replying to ' + replying_to_class.a.get_text() + '\n\n'