python - 如何在 Tweepy 中从 tweet_id 获取 user_id?

标签 python twitter tweepy

我无法从特定的 tweet_id 获取 user_id。有没有办法使用 Tweepy 获取推文的作者 id?

最佳答案

对于该推文的作者,或转发/引用状态尝试。

status = api.get_status(id)
author = status.author
retweeted_status_author = status.retweeted_status.author
quoted_status_author = status.quoted_status.author

关于python - 如何在 Tweepy 中从 tweet_id 获取 user_id?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41371848/

相关文章:

python - re.sub 将所有内容替换为列表中的最后一项

Python(或通用编程)。为什么使用 <> 而不是 != 并且有风险吗?

python - 当未启用急切执行时,张量对象不可迭代。要迭代此张量,请使用 tf.map_fn

javascript - Node.js 中用于获取推文总数的 Do/while 循环仅运行一次

python - 将 Tweepy 与 Apigee 结合使用

python - 如何在 Python 中使用字符串搜索关键字

python - 使用重复条目绘制置信区间和预测区间

Python 请求.exceptions.ConnectionError : HTTPSConnectionPool : Max retries exceeded with url: [Errno 111] Connection refused)

ios - 在IOS SDK中获取微博好友的邮箱Id

Python + Tweepy (STREAM API) - 解析某些值/对象的 JSON 输出