I am using Cakephp 3, and i want to retreive tweets using Twitter Api seach using https://packagist.org/packages/j7mbo/twitter-api-php. This is my code :
class TweetsController extends AppController
{
public function index()
{
$settings = array(
'oauth_access_token' => 'myaccestoken',
'oauth_access_token_secret' => 'myaccestokensecret',
'consumer_key' => 'myconsumerkey',
'consumer_secret' => 'myconsumerkeysecret'
);
$url = 'https://api.twitter.com/1.1/followers/ids.json';
$getfield = '?screen_name=J7mbo';
$requestMethod = 'GET';
$twitter = new TwitterAPIExchange($settings);
echo $twitter->setGetfield($getfield)
->buildOauth($url, $requestMethod)
->performRequest();
$this->set('tweets', $tweets);
}
}
But it's not working, can anyone help ? Thanks