twitter.py 文件源码

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

项目:trump2cash 作者: maxbbraun 项目源码 文件源码
def get_tweets(self, since_id):
        """Looks up metadata for all Trump tweets since the specified ID."""

        tweets = []

        # Include the first ID by passing along an earlier one.
        since_id = str(int(since_id) - 1)

        # Use tweet_mode=extended so we get the full text.
        for status in Cursor(self.twitter_api.user_timeline,
                             user_id=TRUMP_USER_ID, since_id=since_id,
                             tweet_mode="extended").items():

            # Use the raw JSON, just like the streaming API.
            tweets.append(status._json)

        self.logs.debug("Got tweets: %s" % tweets)

        return tweets
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号