tweetcount.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:twitter_word_count 作者: prrateekk 项目源码 文件源码
def on_data(self, data):
        global count
        # Loop keeps on fetching data and incrementing count until the time limit is reached.
        while ((time.time() - self.time) < self.limit):
            try:
                count+=1
                return True
            except BaseException as e:
                time.sleep(5)
                pass
        return False
# StreamListener Class Ends Here.

# REST API that fetches data from the past days till today.
# As per the API documentation twitter allows the user to access Tweets that are no more than 7 days old.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号