Support » Plugin: Get Latest Tweets » [Plugin: Get Latest Tweets] Error on Line 72

  • Just updating the post here:

    The issue is something like this:

    [Tue Mar 08 21:03:22 2011] [error] [client] PHP Warning: file_get_contents( [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] in /home/sites/ on line 72

    To fix this, I changed the following lines (near line 72):

    $json = file_get_contents($url);
    return $json;

    to this:

    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);
    return $json;

  • The topic ‘[Plugin: Get Latest Tweets] Error on Line 72’ is closed to new replies.