#!/usr/bin/perl

system("renice 20 $$");
system("clear");

require "functions.pl";

&CACHE();
exit;

sub CACHE(){

	my $timeout	= "300";
	my $ua		= "Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.6) Gecko/20040206 Firefox/1.0.1";

	my %CACHING = (
		"/server/wwwroot/index.html" => "http://www.zoozle.org/index.php",
	#	"/server/en.wwwroot/index.html" => "http://en.zoozle.net/index.php",
	#	"/server/de.wwwroot/index.html" => "http://de.zoozle.net/index.php",
	);

	while( my ( $path, $url ) = each(%CACHING) ){
		my $page = &http_get($url, $timeout, $ua, );
		if ( length($page) >= 1000 ) {
		
			unlink $path;
			open(WH,">$path");
				print WH $page;
			close WH;

		}; # if ( length($page) >= 1000 ) {
	};

	return 1;

}; # sub CACHE(){}