Forum Topics : Wish List / New Web Service at
It will be interesting to have a small utility script that tells us directly when was done the last modification of the CSV.ZIP file, something like
echo filemtime("/path/to/csv-file.zip");
Some will think to do that REMOTE, like
$URL ="http://ip-to-country.webhosting.info";
$fp = fsockopen($URL,80, $errno,$errstr,30);
if(!fp)
echo "$errstr($errno)\n";
else {
fputs($fp, "HEAD /path/to/csv-file.zip HTTP/1.0\r\n\r\n");
$match = array();
while(!feof($fp)) {
$line = fgets($fp,2280);
if (preg_match ('/^Last-Modified: (.+)$/i',$line,$match))
break;
}
fclose($fp);
if(count($match)>0)
$date = $match[1];
else
$date = " - unknown date - ";
// note that the time is GMT
echo $date."\n";
}
.. but in this case they'll need the /path/to/csv-file.zip thingie, which is actually unknown from afar'
There is another way, to parse directly the download page and extract the date from there .. but this will lead to some uneeded iNet trafic.
If that small script at the top can be implemented, please give us the link.
Thanks Alot!
echo filemtime("/path/to/csv-file.zip");
Some will think to do that REMOTE, like
$URL ="http://ip-to-country.webhosting.info";
$fp = fsockopen($URL,80, $errno,$errstr,30);
if(!fp)
echo "$errstr($errno)\n";
else {
fputs($fp, "HEAD /path/to/csv-file.zip HTTP/1.0\r\n\r\n");
$match = array();
while(!feof($fp)) {
$line = fgets($fp,2280);
if (preg_match ('/^Last-Modified: (.+)$/i',$line,$match))
break;
}
fclose($fp);
if(count($match)>0)
$date = $match[1];
else
$date = " - unknown date - ";
// note that the time is GMT
echo $date."\n";
}
.. but in this case they'll need the /path/to/csv-file.zip thingie, which is actually unknown from afar'
There is another way, to parse directly the download page and extract the date from there .. but this will lead to some uneeded iNet trafic.
If that small script at the top can be implemented, please give us the link.
Thanks Alot!
