Page 1 of 1

help needed with code to copy a file

Posted: Wed Jun 06, 2007 2:21 pm
by vineet7kumar
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


hi everyBuddy,

        I wrote a code to copy a RSS feed file from various sites...

[i]code  part to copy the file: [/i]

Code: Select all

//$rss_url1 = "http://www.digg.com/rss/index.xml";
$rss_url1 = "http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml";
$file = md5($rss_url1);
$path = "$file.xml";
copy($rss_url1,$path);
I tested it for various links ... it's working... but for the link
"http://www.digg.com/rss/index.xml"
it is not working... it is showing a error
" Warning: copy(http://www.digg.com/rss/index.xml) [function.copy]: failed to open stream: HTTP request failed! in..... "

what could be the possible reason and it's solution?

thanks and regards,
viny


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed Jun 06, 2007 4:33 pm
by thomas777neo
It probably requires authentication. I also noticed the xml file has its own custom tags.

Don't know how to fix it though. My RSS reader just returns errors as well.

My guess is that it is an authentication thing.

Posted: Wed Jun 06, 2007 5:41 pm
by maliskoleather
I believe that digg blocks the PHP useragent.

you may want to look into cURL