def run(self): while self.dorun: time.sleep(self.interval) self.repcount += 1 with self.lock: for k, v in self.counts.items(): logging.info("Collected tweets - {0}: {1}".format(k, v)) self.counts = {} if self.repcount >= self.rep_interval: twicol.send_tweet(self.api_settings, self.get_tweet_report()) self.repcount = 0 self.countsl = {}
def send_tweet(): twicol.send_tweet(api_settings, tweet_text)