简体   繁体   English

使用亚伯拉罕的twitteroauth:“关注者/ id” next_cursor始终为0

[英]Using abraham's twitteroauth: The “followers/ids” next_cursor is always 0

twitteroauth has been fantastic up until now, but I'm having trouble gathering all of the followers of certain users. 到目前为止,twitteroauth一直很棒,但是我很难收集某些用户的所有关注者。

For example: 例如:

$method = 'followers/ids';
$params = array("screen_name"=>"governoromalley","cursor"=>"-1");
print_r($conn->get($method));

Returns / Prints the object claiming that there is only a 0 for next_cursor : 返回/打印声称next_cursor只有0的对象

stdClass Object ( [previous_cursor_str] => 0 [next_cursor] => 0 [ids] => 
Array ( [0] => 353642204 [1] => 98012791 [2] => 72607824 [3] =>...

But, when curling via the http://dev.twitter.com OAuth tool, I get something showing that the next_cursor is there , but I can't seem to get it via the PHP SDK. 但是,当通过http://dev.twitter.com OAuth工具进行卷发时,我看到的东西表明next_cursor在那里 ,但是我似乎无法通过PHP SDK来获得它。

{"previous_cursor_str":"0","next_cursor":1380213447767347311,"ids":
[23639237,324619439,282668815,...

How can I solve this conundrum? 我该如何解决这个难题? I'm willing to do any silly hacks as necessary. 我愿意根据需要进行任何愚蠢的修改。

Thanks for any help! 谢谢你的帮助!

Ended up figuring it out. 最终弄清楚了。 Seems like twitteroauth sdk wants user_ids instead: 似乎twitteroauth sdk想要使用user_ids来代替:

//Where GovernorOMalley's user_id = 15824288
$method = 'followers/ids/15824288'; 
print_r($conn->get($method)); 

Gives the proper cursor elements. 提供适当的光标元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM