我不能让它工作。我有有效的凭据,我正试图使用此代码获取特定推文的转发(我以前经过身份验证):
$retweets= $twitConn->get("/statuses/retweets/".$tweet_id.".json", array('count'=>100));
foreach($retweets as $rt){
//... some extra stuff
}
我也试着省略了"。Json ",但我总是得到:
<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 />
和print_r($retweets)没有输出。提前感谢!如果你能帮助我,我将非常感激。
我认为它根本没有获得任何数据,检查是否设置了所有Oauth参数。还可以尝试打印出tweet ID。
使用这个作为api请求。
$request = "api.twitter.com/1/statuses/{$id}/retweeted_by.xml";