All,
I have the following code:
$c = curl_init();
curl_setopt($c, CURLOPT_URL, "https://api.twitter.com/1/statuses/user_timeline.json?screen_name={$username}&count={$how_many}");
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec($c);
curl_close($c);
if ( ! empty( $contents ) ) {
// Decode it.
echo "it is in here";
$tweet = json_decode( $contents );
}
This code never gets into the if statement because it isn’t returning any results. Any idea on how to get this to return all of the results?
Thanks!
Looks like your server doesn’t trust Twitter’s certificate authority (you’re probably getting an SSL error but not seeing it due to your error reporting settings).
Follow this guide to get it working – http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/