Issue processing RSS feed with Perl/CURL

360 views Asked by At

I have this RSS feed URL:

http://mediosymedia.com/wp-content/plugins/nextgen-gallery/xml/media-rss.php

A client is trying to access to this RSS programmatically via PERL like this:

# Fetch the content available in source HTTP URL
`curl -g --compressed "$source_url" > $tempRSSFile`; 

Where $source_url is http://mediosymedia.com/wp-content/plugins/nextgen-gallery/xml/media-rss.php

But they said that they couldn't access the feed this way with my URL, I know nothing about PERL so, you guys could point me in the right direction to make a compatible URL for the feed?

Thanks a lot!

1

There are 1 answers

2
Slaven Rezic On

The problem has nothing to do with perl. If you run the curl command from cmdline, then you get a Error 406 - Not Acceptable error. One possibility is to trick mod_security by using another User-Agent header. This works right now:

curl --user-agent Mozilla/5.0 -g --compressed http://mediosymedia.com/wp-content/plugins/nextgen-gallery/xml/media-rss.php > /tmp/feed.rss

But better, as amon already said, is to fix the server and allow RSS download also for curl.