[Plugin: Get Latest Tweets] Error on Line 72
-
Just updating the post here: http://ww.wp.xz.cn/support/topic/plugin-get-latest-tweets-plugin-error?replies=3
The issue is something like this:
[Tue Mar 08 21:03:22 2011] [error] [client 188.221.109.83] PHP Warning: file_get_contents(http://twitter.com/status/user_timeline/stephenfry.json) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request\r [Tue Mar 08 21:03:22 2011] [error] [client 188.221.109.83] in /home/sites/martyn-roberts.co.uk/public_html/cycleafrica/wordpress/wp-content/plugins/get-latest-tweets/get-latest-tweets.php on line 72To fix this, I changed the following lines (near line 72):
$json = file_get_contents($url); return $json;to this:
$curl_handle=curl_init(); curl_setopt($curl_handle, CURLOPT_URL, $url); curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_handle, CURLOPT_USERAGENT, 'Fiddler'); $json = curl_exec($curl_handle); curl_close($curl_handle); return $json;
The topic ‘[Plugin: Get Latest Tweets] Error on Line 72’ is closed to new replies.