php - twitter api 1.1 - returning NULL -
i trying use twitters api in order retrieve list of hashtagged results - used quite easy because no need authentication become tricky me...
i have followed post https://stackoverflow.com/questions/12916539/simplest-php-example-for-retrieving-user-timeline-with-twitter-api-version-1-1/15314662#=
but when load page displays null - sure have done every thing correct
notice - php file below in same directory file twitterapiexchange
help appreciated thanx
<?php ini_set('display_errors', 1); require_once('twitterapiexchange.php'); /** set access tokens here - see: https://dev.twitter.com/apps/ **/ $settings = array( 'oauth_access_token' => "xxxxx", 'oauth_access_token_secret' => "xxxxx", 'consumer_key' => "xxxxx", 'consumer_secret' => "xxxxx" ); $url = 'https://api.twitter.com/1.1/statuses/user_timeline.json'; $getfield = '?screen_name=j7mbo'; $requestmethod = 'get'; $twitter = new twitterapiexchange($settings); $response = $twitter->setgetfield($getfield) ->buildoauth($url, $requestmethod) ->performrequest(); var_dump(json_decode($response)); ?>
add curlopt_ssl_verifypeer => false curl options within performrequest() method in twitterapiexchange.php. seems solve it.
cf here
Comments
Post a Comment