<?
include 'adv_wdt.php';
$wdt = new adv_wdt;
$url = "http://google.com/"; // set desired URL to tracking
// print_R ( $wdt-> curl ($url)); // just return page content
// echo "<li> Page length is:".$wdt->curl[length]." , and MD5 checksum: ".$wdt->curl[checksum]."<br>";
$wdt->sql_connect ('localhost','username','password','dbname','adv_wdt'); // connect to temporary SQL table, need create first one
// $wdt -> sql_conect ('host','username','password','database','table');
$wdt->sql_delURL($url); // delete URL from table if any
$wdt->sql_addURL($url); // add URL to our table
echo "<li> $url is added, current length is ".$wdt->curl[length]."<br>";
if ($wdt->sql_diffURL($url) == true ) { // check if webpage has changed since last add URL, only active records are checking !
echo "<li> $url has changed new length is ".$wdt->curl[length]."<br>";
// $wdt->sql_deactivateURL($url); // instead of delete you can only deactivate URL
// $wdt->sql_activateURL($url); // active URL previously deactivated
$wdt->sql_delURL($url); // delete URL from table
} // diffURL
|