true, // return web page CURLOPT_HEADER => false, // don't return headers CURLOPT_FOLLOWLOCATION => true, // follow redirects CURLOPT_ENCODING => "", // handle all encodings CURLOPT_USERAGENT => "spider", // who am i CURLOPT_AUTOREFERER => true, // set referer on redirect CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect CURLOPT_TIMEOUT => 120, // timeout on response CURLOPT_MAXREDIRS => 10, // stop after 10 redirects ); $ch = curl_init( $url ); curl_setopt_array( $ch, $options ); $content = curl_exec( $ch ); $err = curl_errno( $ch ); $errmsg = curl_error( $ch ); $header = curl_getinfo( $ch ); curl_close( $ch ); $header['errno'] = $err; $header['errmsg'] = $errmsg; $header['content'] = $content; return $header; } /** * Returns XML information if cURL is not installed * * @return string The XML */ function no_curl_installed() { return ' ArrowChat http://www.arrowchat.com/blog Just another WordPress weblog Thu, 20 May 2010 12:14:53 +0000 http://wordpress.org/?v=2.9.2 en hourly 1 Unable to Load ArrowChat Blog http://www.arrowchat.com/blog/ http://www.arrowchat.com/blog/ Thu, 20 May 2010 12:14:53 +0000 admin http://www.arrowchat.com/blog/ http://www.arrowchat.com/blog/?feed=rss2 0 '; } // Figure out if cURL is installed if (function_exists('curl_init')) { $result = get_web_page($_REQUEST['url']); $buffer = $result['content']; } else { $buffer = no_curl_installed(); } header('Content-type: application/xml'); echo $buffer; ?>