I am trying to get the tweets of a person through codebird-php This is my code:
<?php
require_once('src/codebird.php');
\Codebird\Codebird::setConsumerKey('Consumer Key', 'Consumer Secret');
$cb = \Codebird\Codebird::getInstance();
$cb->setToken('Oauth Key', 'Oauth Secret');
$params = array(
'screen_name' => 'WWE',
'count' => 2
);
$reply = $cb->statuses_userTimeline($params);
json_decode($reply);
$main = $reply[0]->text;
echo '<pre>';
var_dump($reply);
echo '</pre>';
And Some Of The Output Of the var_dump($reply)
is
object(stdClass)#35 (4) {
[0]=>
object(stdClass)#2 (23) {
["created_at"]=>
string(30) "Mon Jan 26 08:30:10 +0000 2015"
["id"]=>
float(5.5962935475884E+17)
["id_str"]=>
string(18) "559629354758844416"
["text"]=>
string(112) "RT @WWENXT: .@WWERomanReigns has just made history by becoming the FIRST #WWENXT alumnus to win the #RoyalRumble"
["source"]=>
string(63) "Hootsuite"
["truncated"]=>
bool(false)
["in_reply_to_status_id"]=>
NULL
..........
But The json_decode($reply)
returns Warning: json_decode() expects parameter 1 to be string, object given
Any Help Will Be Very Much Appreciated...
Thanks. Cheers