【问题标题】:How to exclude replies and retweets from Twitter with Python GetOldTweets3如何使用 Python GetOldTweets3 从 Twitter 中排除回复和转发
【发布时间】:2020-08-16 02:06:15
【问题描述】:

我正在使用 python 包 GetOldTweets3 在特定时间范围内从特定用户提取所有推文。但是,我只想要“原始”推文,而不需要用户做出的公开回复或转发。

是否有可能使用 GetOldTweets3 或任何方式来扩展包?

    import GetOldTweets3 as got
    tweetCriteria = 
        got.manager.TweetCriteria().setUsername(username).setSince(startdate).setUntil(enddate)
    tweets = got.manager.TweetManager.getTweets(tweetCriteria)

【问题讨论】:

  • 不是machine-learning 问题,请不要向无关标签发送垃圾邮件(已删除)。

标签: python twitter


【解决方案1】:

我最近一直在使用 GetOldTweets3,我认为您不会从结果中获得用户转发。对于回复,您可以通过将 tweet.to 添加到结果中来获取每条记录的回复,然后选择具有 null 的记录。

【讨论】:

    猜你喜欢
    • 2021-05-26
    • 2019-10-13
    • 2020-12-12
    • 2015-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-09
    • 2011-08-25
    相关资源
    最近更新 更多