bird.py 文件源码

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

项目:analyst-scripts 作者: Te-k 项目源码 文件源码
def get_searched_tweets(self, hashtag, since_id=None):
        """
        Search all tweets for a hashtag
        """
        if self.api is None:
            self._authenticate()

        tweets = []
        if since_id:
            cursor = tweepy.Cursor(self.api.search, q=hashtag, count=100, since_id=since_id)
        else:
            cursor = tweepy.Cursor(self.api.search, q=hashtag, count=100)
        try:
            for item in cursor.items():
                tweets.append(item)
        except tweepy.error.TweepError:
            print("Reached Twitter rate limit")
        return tweets
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号