/*
// Yahoo Tempo
//
//
// Author: Pablo Costa
// Lastmod: 2000-03-00
// Homepage: http://shark.ib.usp.br
//
// PHP:
//
// include("yahootempo.php");
// ?>
//
//
*/
// Configure
$cache_file = "/tmp/yahootempo.net.cache"; // Arquivo de cache
$cache_time = 43200; // Atualiza de 12 em 12 horas
$url = "http://br.tempo.yahoo.com/222/index_c.html";
$time = split(" ", microtime());
srand((double)microtime()*1000000);
$cache_time_rnd = 300 - rand(0, 600);
if ( (!(file_exists($cache_file))) || ((filectime($cache_file) + $cache_time - $time[1]) + $cache_time_rnd < 0) || (!(filesize($cache_file))) ) {
$fpread = fopen($url, 'r');
if(!$fpread) {
echo "$errstr ($errno)
\n";
exit;
} else {
$rf = fread($fpread, 20000);
$grab = eregi("
(.*)