From 24598f0b87a602f3501f4b2d9ca189756931afc0 Mon Sep 17 00:00:00 2001 From: b3yond Date: Fri, 5 Oct 2018 11:02:12 +0200 Subject: [PATCH] crawl only mentions, no replies --- active_bots/twitterbot.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/active_bots/twitterbot.py b/active_bots/twitterbot.py index d11efca..7b56523 100755 --- a/active_bots/twitterbot.py +++ b/active_bots/twitterbot.py @@ -50,11 +50,13 @@ class TwitterBot(Bot): text = re.sub( "(?<=^|(?<=[^a-zA-Z0-9-_\.]))@([A-Za-z]+[A-Za-z0-9-_]+)", "", status.text) - reports.append(report.Report(status.author.screen_name, - self, - text, - status.id, - status.created_at)) + username = api.me() + if username in status.text: + reports.append(report.Report(status.author.screen_name, + self, + text, + status.id, + status.created_at)) user.save_seen_tweet(status.id) return reports except tweepy.RateLimitError: