JavaScript Editor Ajax software     Free javascripts 



Main Page

// read the latest iplists version
$version_url = ‘http://www.iplists.com/nw/version.php’;
$latest_version = mysql_escape_string(file_get_contents($version_url));
// if no updated version information was retrieved, abort
if (!$latest_version)
{
// return false to indicate an update wasn’t performed
return false;
}
// save the update data
$q = “DELETE FROM cloak_update”;
mysql_query($q);
$q = “INSERT INTO cloak_update (version, updated_on) “ .
“VALUES(‘$latest_version’, NOW())“;
mysql_query($q);
// if we already have the current data, don’t attempt an update
if ($latest_version == $db_version)
{
// close database connection
mysql_close($dbLink);
// return false to indicate an update wasn’t performed
return false;
}
// update the database
SimpleCloak::_updateCloakingDB(‘google’,
‘http://www.iplists.com/nw/google.txt’);
SimpleCloak::_updateCloakingDB(‘yahoo’,
‘http://www.iplists.com/nw/inktomi.txt’);
SimpleCloak::_updateCloakingDB(‘msn’,
‘http://www.iplists.com/nw/msn.txt’);
SimpleCloak::_updateCloakingDB(‘ask’,
‘http://www.iplists.com/nw/askjeeves.txt’);
SimpleCloak::_updateCloakingDB(‘altavista’,
‘http://www.iplists.com/nw/altavista.txt’);
SimpleCloak::_updateCloakingDB(‘lycos’,
‘http://www.iplists.com/nw/lycos.txt’);
SimpleCloak::_updateCloakingDB(‘wisenut’,
‘http://www.iplists.com/nw/wisenut.txt’);
// close connection
mysql_close($dbLink);
// return true to indicate a successful update
return true;
}
// update the database for the mentioned spider, by reading the provided URL
function _updateCloakingDB($spider_name, $url,
$ua_regex = ‘/^# UA “(.*)“$/m’, $ip_regex = ‘/^([0-9.]+)$/m’)
228
Chapter 11: Cloaking, Geo-Targeting, and IP Delivery
c11.qxd:c11 11:01 228


JavaScript Editor Ajax software     Free javascripts