def on_status(self, status):
print("{0}: {1}".format(status.text, status.author.screen_name))
screen_name = status.author.screen_name
# ignore my tweets
if screen_name == self.api.me().screen_name:
print("Ignored my tweet")
return True
elif status.text.startswith("@{0}".format(self.api.me().screen_name)):
# Save mentions
print("Saved mention")
insert_tweet(status.id, status)
return True
else:
if self.next_tweet_time < datetime.today():
print("Saving normal tweet as seed")
self.next_tweet_time = self.get_next_tweet_time()
insert_tweet(status.id, status, bot_flag=SHOULD_TWEET)
print("Ignored this tweet")
return True
tweet_listener.py 文件源码
python
阅读 31
收藏 0
点赞 0
评论 0
评论列表
文章目录