开发者

How to correctly fetch for retweets with TwitterOAuth php class?

开发者 https://www.devze.com 2023-04-03 14:00 出处:网络
I can\'t make it work. I have valid credentials, i\'m trying to fetch retweets of an specific tweet using this code (i previously authenticated):

I can't make it work. I have valid credentials, i'm trying to fetch retweets of an specific tweet using this code (i previously authenticated):

$re开发者_运维百科tweets= $twitConn->get("/statuses/retweets/".$tweet_id.".json", array('count'=>100));
foreach($retweets as $rt){
    //... some extra stuff
}

I've also tried omitting the ".json", but i always get:

<b>Warning</b>:  Invalid argument supplied for foreach() in  <b>/home/content/70/8339770/html/app/retweets.php</b> on line <b>81</b><br /> 

and i get no output with print_r($retweets). Thanks in advance! I would really appreciate if you could help me


I think it's not getting any data at all, check if all Oauth parameters are set. Also try printing out the tweet ID.

Use this as the api request.

$request = "api.twitter.com/1/statuses/{$id}/retweeted_by.xml";
0

精彩评论

暂无评论...
验证码 换一张
取 消