$refresh=60;
if(isset($_GET['refresh']))
$refresh=$_GET['refresh'];
if($refresh<10)
$refresh=10;
echo("Woot-Off Checker
");
echo("This page may take a while to load depending on woot, refreshes every $refresh seconds.
CGI-issues occur when woot page receives heavy loads or woot is changing items, just refresh and it should come back.
Added some CGI protection, mostly depends on hits/woots site speed.
");
//$handle = fopen("http://woot.com/", "r");
//$file=file_get_contents("http://woot.com");
//echo($file);
$ch = curl_init();
$timeout = 2; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, 'http://www.woot.com');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt ($ch, CURLOPT_TIMEOUT, $timeout);
$file = curl_exec($ch);
curl_close($ch);
//echo($file);
$message="";
if(strlen($file)==0)
{
$message="Failed to contact woot, refreshing in 15 seconds to try again and give the woot server a break";
?>
}
else
{
?>
$value=0;
for($i=0;$i