writer Posted May 13, 2008 Share Posted May 13, 2008 I'm wondering if there's a way to copy remote XML data using a script with a cronjob put on it. Has anyone ever seen something like this? Link to comment https://forums.phpfreaks.com/topic/105512-setting-up-a-script-to-scrape-and-copy-an-xml-feed/ Share on other sites More sharing options...
DarkWater Posted May 13, 2008 Share Posted May 13, 2008 Of course it's possible, it's just like any other script....make the script and just give it to cron. Link to comment https://forums.phpfreaks.com/topic/105512-setting-up-a-script-to-scrape-and-copy-an-xml-feed/#findComment-540465 Share on other sites More sharing options...
writer Posted May 14, 2008 Author Share Posted May 14, 2008 I take it by your tone that there's a really easy way to copy an XML file? Link to comment https://forums.phpfreaks.com/topic/105512-setting-up-a-script-to-scrape-and-copy-an-xml-feed/#findComment-540548 Share on other sites More sharing options...
DarkWater Posted May 14, 2008 Share Posted May 14, 2008 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 Link to comment https://forums.phpfreaks.com/topic/105512-setting-up-a-script-to-scrape-and-copy-an-xml-feed/#findComment-540554 Share on other sites More sharing options...
writer Posted May 14, 2008 Author Share Posted May 14, 2008 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 Link to comment https://forums.phpfreaks.com/topic/105512-setting-up-a-script-to-scrape-and-copy-an-xml-feed/#findComment-541182 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.