Come linkare dmoz (Was: idee x il sito)

Gabriele Mambrini gm@badpenguin.org
Mon, 6 Aug 2001 18:45:19 -0400


Se funziona è fatta...
-----------------------------------------------------------------------
function dmoz_grabber($url) {
	$fd = fopen ($url, "r");
	while (!feof ($fd)) {
		$buffer = chop(fgets($fd, 4096));
		unset($matches);
		eregi("<li><a href=\"([^\"]*)\">([^<]*)</a> - (.*)", 
			$buffer,$matches);
		if(sizeof($matches)) {
			echo $matches[1]."\n";
			echo $matches[2]."\n";
			echo $matches[3]."\n\n";	
		}
	}
	fclose ($fd);
}
-----------------------------------------------------------------------
-- 
Gabriele