<?

//URL of a post on your blog
$url $_GET['url'];

if(
$_GET['google'] == 1
{
    
//spider agent
    
$user_agent "Googlebot";
}
else
{
    
//regular agent
    
$user_agent "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; .NET CLR 3.5.21022)";
}

//spit out the page
echo page_curl($url);

//curl with user agent setting
function page_curl($url)
{
    global 
$user_agent;
    
    
$data curl_init();
    
curl_setopt($dataCURLOPT_URL$url);
    
curl_setopt($dataCURLOPT_USERAGENT,  $user_agent);
    
curl_setopt($data,CURLOPT_CONNECTTIMEOUT,2);
    
curl_setopt($dataCURLOPT_HEADER0);
    
curl_setopt($dataCURLOPT_RETURNTRANSFER1);
    
$page curl_exec($data);
    
curl_close($data);

    return 
$page;
}

?>