Jump to content

Setting up a script to scrape and copy an XML feed


writer

Recommended Posts

Copy it?  Just download it and save it?

 

$path = "http://www.example.com/test.xml";

$xml = file_get_contents($path);

$name = substr($path, strrpos("/", $path"), strlen($path));

$file = fopen($name . time(), "w");

fwrite($file, $xml);

fclose($file);

 

O_O

 

 

Thanks for the code!

 

Hmm. Any way around this?

 

Warning: fopen(http://www.dapper.net/RunDapp?dappName=TheDrudgeReportRSS&v=1&applyToUrl=http%3A%2F%2Fwww.drudgereport.com1210792822) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/taylorwb/public_html/aheds/scrape.php on line 6

Warning: fwrite(): supplied argument is not a valid stream resource in /home/taylorwb/public_html/aheds/scrape.php on line 7

Warning: fclose(): supplied argument is not a valid stream resource in /home/taylorwb/public_html/aheds/scrape.php on line 8

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.