Nicolas February 2016

Twitter API - get tweets with id_str

Sorry , I have a problem with this script : It's for get tweet with specific 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;
}

Warning: Invalid argument supplied for foreach()

Thank you so much for your help Nicolas

Answers


Mounir Elfassi February 2016

remove ->statuses, like:

$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;
}

Post Status

Asked in February 2016
Viewed 2,039 times
Voted 11
Answered 1 times

Search




Leave an answer