From 3bedb32f92c350d7664830d3b716e2a1b6784b15 Mon Sep 17 00:00:00 2001 From: Aanand Prasad Date: Tue, 25 Nov 2014 11:24:17 +0000 Subject: [PATCH 1/2] Fix bug where followers were never being checked --- twitterbot/bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twitterbot/bot.py b/twitterbot/bot.py index 3c49414..32dbbe1 100644 --- a/twitterbot/bot.py +++ b/twitterbot/bot.py @@ -373,7 +373,7 @@ def run(self): # check followers every 15 minutes #if self.autofollow and (time.time() - self.last_follow_check) > (15 * 60): - if self.state['last_follow_check'] > (15 * 60): + if (time.time() - self.state['last_follow_check']) > (15 * 60): self._check_followers() self._handle_followers() From 296071e51d879b880a700495b0714239861f31f5 Mon Sep 17 00:00:00 2001 From: Aanand Prasad Date: Sun, 26 Jul 2015 14:34:31 +0100 Subject: [PATCH 2/2] Fix bug where followers were being checked too often --- twitterbot/bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twitterbot/bot.py b/twitterbot/bot.py index 32dbbe1..5b126ce 100644 --- a/twitterbot/bot.py +++ b/twitterbot/bot.py @@ -337,7 +337,7 @@ def _check_followers(self): try: self.state['new_followers'] = [f_id for f_id in self.api.followers_ids(self.id) if f_id not in self.state['followers']] - self.config['last_follow_check'] = time.time() + self.state['last_follow_check'] = time.time() except tweepy.TweepError as e: self._log_tweepy_error('Can\'t update followers', e)