Har måske noget:
<?
/*
Contentgrabber v3.0a
Copyright (C) Arvid Bux
Distributed under the terms of the GNU General Public License
Arvid@ArvidBux.nl
www.arvidbux.nl THIS IS AN APLHA VERSION, SO WHEN YOU ENCOUNTER BUGS MAIL THEM TO ARVID@ARVIDBUX.NL
OR GO TO
http://www.arvidbux.nl/weblog/comments.php?id=P26_0_1_0 */
$url = "
http://url.to.com/"; // Trailing slash when not using filename
$file = "content.inc"; // file to write to. remember to chmod 777 to not get errors
$unique_start = "<html>"; // Where to begin to grab
$unique_end = "</html>"; // Where to end the grab
######################################################
## No editing below here
## Editing below this line voids warranty
######################################################
ini_set('max_execution_time', '0');
flush ();
// fetch domein from url
$fetch_domain = parse_url($url);
$fetch_domain = $fetch_domain[host];
// Host checking code
$socket_handle = fsockopen("$fetch_domain", 80, $error_nr, $error_txt,30);
if(!$socket_handle)
{
print("Cannot make a connection to: $fetch_domain and therefore cannot collect your requested data");
$contents = implode("",@file( $file ) );
echo $contents;
exit;
}
$fd= fread(fopen("$url", "r"), 100000);
if ($fd)
{
$start= strpos($fd, "$unique_start");
$finish= strpos($fd, "$unique_end");
$length= $finish-$start;
$code=Substr($fd, $start, $length);
}
######################################################
## No editing above here
## Editing above this line voids warranty
######################################################
// $code = preg_replace("new code", "old code", $code);
// uncomment the above line to edit the output
echo $code;
$tmpfile = fopen($file,"w+");
$fp = fwrite($tmpfile,$code);
fclose($tmpfile);
flush ();
?>