Twitter API - 使用id_str获取推文

时间:2016-02-08 22:55:05

标签: api twitter

抱歉,我对此脚本有疑问: 这是用于获取具有特定ID的推文;

$tweetlist = $twitter->get('https://api.twitter.com/1.1/statuses/show.json?id=694658584664236033');

foreach ($tweetlist->statuses as $key => $value) {

    $message = utf8_decode($value->text);
    echo $message;
}
  

警告:为foreach()提供的参数无效

非常感谢你的帮助 尼古拉斯

1 个答案:

答案 0 :(得分:0)

删除->statuses,例如:

$tweetlist = $twitter->get('https://api.twitter.com/1.1/statuses/show.json?id=694658584664236033');

foreach ($tweetlist as $key => $value) {

$message = utf8_decode($value->text);
echo $message;
}