使用Twitter的API命令FPGA实现的Python困难 [英] difficulty using twitter api command implemention in python

查看:332
本文介绍了使用Twitter的API命令FPGA实现的Python困难的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎没有人能回答我的问题,并在其他职位我找不到它。使用Twitter的API,我想在推特ID进入和返回所有谁转推的推特用户的数组。

No one seems to be able to answer my question and I can not find it in the other posts. Using twitter's api, I want to enter in a tweet id and return an array of all the users who retweeted that tweet.

例如:

input -> retweeters(tweet_id)

output -> ['username1','username2','username3','username4']

这可以此链接

我不需要鸣叫或转推,我需要谁转推的一个特定的tweet所以因此retweets_of_me不会有所帮助这里的人的用户名。如果你帮我,我会非常感激。谢谢

I do not need the tweet or the retweet, I need the usernames of the people who retweeted a particular tweet so therefore retweets_of_me would not be helpful here. If you help me out, I'd be very grateful. Thank you

推荐答案

您可以使用 twython ,该允许您访问Twitter的API,并收集retweeter ID列表具有以下code:

You can use twython, which allows you to access the Twitter API and collect the list of retweeter IDs with the following code:

from twython import Twython

twitter = Twython(APP_KEY, APP_SECRET,OAUTH_TOKEN, OAUTH_TOKEN_SECRET)

search = twitter.get_retweeters_ids(id=327473909412814850)

for result in search["ids"]:
    print result

get_retweeters_ids()函数使用相同的参数Twitter的API调用,这是您要跟踪鸣叫的ID。其结果是,包含在该领域的retweeter ID的JSON对象IDS。

The get_retweeters_ids() function takes the same arguments as the Twitter API call, which is the id of the Tweet you want to track. The result is a JSON object that contains the retweeter IDs in the field "ids".

我希望这有助于。

这篇关于使用Twitter的API命令FPGA实现的Python困难的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆