【问题标题】:Twitter API - Getting the retweet count of an accountTwitter API - 获取帐户的转发计数
【发布时间】:2014-06-14 19:54:53
【问题描述】:

我希望提取特定用户收到的转发总数。这可能吗?

现在,我可以提取推文总数、关注者数量和朋友数量。

我正在使用的代码是:

$username = "username";
$url = "https://api.twitter.com/1.1/users/show.json";
$requestMethod = "GET";
$getfield = "?screen_name=".$username."&include_entities=true";
$twitter = new TwitterAPIExchange($settings);
$string = json_decode($twitter->setGetfield($getfield)
    ->buildOauth($url, $requestMethod)
    ->performRequest(),$assoc = TRUE);

【问题讨论】:

    标签: php json twitter


    【解决方案1】:

    转发总数不是与Users 关联的属性。每个Tweet 在字段 retweet_count 中都有收到的转推数。

    您需要获取用户的所有推文,并将转发次数相加,以获得用户收到的总转发次数。您会发现的问题是,您可以从用户那里获得的推文数量受到限制,仅限于最后 3200 条推文https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-user_timeline.html

    【讨论】:

    • 您好,我们不能使用 retweets_of_me 端点来获取此信息吗?
    • @Sonal 您可以使用该端点获得Tweets authored by the authenticating user that have been retweeted by others,我认为最初的问题需要任何用户的数据。
    猜你喜欢
    • 1970-01-01
    • 2021-12-25
    • 2016-12-18
    • 2015-07-16
    • 1970-01-01
    • 2013-06-13
    • 2012-12-12
    • 1970-01-01
    • 2015-06-26
    相关资源
    最近更新 更多