Title: [Plugin: Get Latest Tweets] Plugin error
Last modified: August 19, 2016

---

# [Plugin: Get Latest Tweets] Plugin error

 *  [ted_the_bad](https://wordpress.org/support/users/ted_the_bad/)
 * (@ted_the_bad)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-get-latest-tweets-plugin-error/)
 * Hi
 * I’m getting an occasional error using the plugin. The error log from my website
   is as follows:
 * > [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](http://twitter.com/status/user_timeline/stephenfry.json))[
   > [function.file-get-contents](https://wordpress.org/support/topic/plugin-get-latest-tweets-plugin-error/function.file-get-contents?output_format=md)]:
   > 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 72
 * Line 72 is:
    $json = file_get_contents($url);
 * Is there any particular reason that the plugin would fail to get the information
   from twitter using the file_get_contents function?
 * Thanks
 * [http://wordpress.org/extend/plugins/get-latest-tweets/](http://wordpress.org/extend/plugins/get-latest-tweets/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [ted_the_bad](https://wordpress.org/support/users/ted_the_bad/)
 * (@ted_the_bad)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-get-latest-tweets-plugin-error/#post-1964328)
 * Nevermind, I found a solution.
 * For anyone who may come across the same problem, change the following lines from:
   **
   $url = “[http://twitter.com/status/user_timeline/$username.json&#8221](http://twitter.com/status/user_timeline/$username.json&#8221);;
   $json = file_get_contents($url); return $json;
 * to this:
    **$curl_handle=curl_init(); curl_setopt($curl_handle, CURLOPT_URL,”
   [http://twitter.com/status/user_timeline/$username.json&#8221](http://twitter.com/status/user_timeline/$username.json&#8221););
   curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2); curl_setopt($curl_handle,
   CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_handle, CURLOPT_USERAGENT, ‘Twitter’);
   $json = curl_exec($curl_handle); curl_close($curl_handle); return $json;
 *  [abuhaafidh](https://wordpress.org/support/users/abuhaafidh/)
 * (@abuhaafidh)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-get-latest-tweets-plugin-error/#post-1964431)
 * I’m having the same problem sometimes. I’ve tried adding your code but this is
   what I got..
 * > R
   >  / over a year ago

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Get Latest Tweets] Plugin error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/get-latest-tweets.svg)
 * [Get Latest Tweets](https://wordpress.org/plugins/get-latest-tweets/)
 * [Support Threads](https://wordpress.org/support/plugin/get-latest-tweets/)
 * [Active Topics](https://wordpress.org/support/plugin/get-latest-tweets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/get-latest-tweets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/get-latest-tweets/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [abuhaafidh](https://wordpress.org/support/users/abuhaafidh/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-get-latest-tweets-plugin-error/#post-1964431)
 * Status: not resolved