def actionable(self,statuses): if len(statuses) > 0: most_recent_status=statuses[0] td=timeutils.time_since(most_recent_status.created_at) if td < self._max_actionable_age.timedelta: return True return False
def on_watched_timelines(self,statuses): if self._me.screen_name not in statuses: return my_timeline = statuses[self._me.screen_name] if len(my_timeline)==0: # no tweets yet, let's get started! print "WARNING: No tweets found for this bot. Proceeding with initial tweet!" self.generate_and_tweet() else: most_recent_tweet=my_timeline[0] td = timeutils.time_since(most_recent_tweet.created_at) if td > self._period_between_tweets.timedelta: self.generate_and_tweet()