RSS Feed on site


#1

Please be patient with me, as I’m a novice in this area. I have a client who has a Flash website and wants an RSS feed from ESPN on his site. Fine. I installed a cool component with the feed and it works - locally. After not seeing it on the Web, I understand DH doesn’t support RSS feeds from other locations. The wiki I was pointed to is very confusing. Does anyone have an easy-to-understand workaround for this? The client is insisting on this ability.


#2

Hello!

I had a similar problem a little while back, and if I remember correctly my solution was to set up my own copy of php.ini so that I can allow PHP to open URL’s. For more information about custom php.ini files check out:

http://www.wiki.dreamhost.com/Custom_PHP.ini

Also, this is not a “simple” work around, but it should work. And, out of curiosity which wiki article did you read about RSS feeds?


#3

Thanks for the quick response, BTW. I’ll check out the Custom_PHP wiki. In answer to your question, this is the Wiki I was pointed to earlier: http://wiki.dreamhost.com/Using_XML_Parser_without_allow_url_fopen


#4

Actually DreamHost “supports” RSS feeds from other sites just fine - I use them all the time. :wink:

What DH does not “support” is grabbing RSS feeds, or other content, via url_fopen in PHP, and that is a good thing for all of us on shared servers as it is a necessary and reasonable security precaution.

You didn’t specify what wiki article you were pointed to, but Lighbulbone may be “spot on” if your code is trying to use url_fopen to grab the feed.

At any rate, if you search these forums for RSS feed related threads, you will see there are many ways to use RSS feeds in your sites on DreamHost. (Though Flash can present special challenges) :wink:

–rlparker


#5

Another alternative might be for you to grab the feed from ESPN and store a copy of it locally in your user space on the DreamHost server using cURL or wget run from a cron job, and then see if your “component” can read it from there.

–rlparker


#6

allow_url_fopen is EVIL.

Maximum Cash Discount on any plan with MAXCASH


#7

Man, this is way more complicated than I was expecting. Again, I’m new to coding and I cheat by using flash components, so yes, I’m lame (for now). When you say store a copy of it on my user space, how do you go about that?


#8

Essentially what I was talking about doing is using a unix shell command (curl or wget) to go out and get a copy of the rss file from the site offering it and save it on your server. The particulars of how you do that can be obtained by reading the documentation for the curl and wget programs. Both of these programs are available for your use on your DreamHost server.

My thought was if your “component” can read the RSS file via a server/system path as well as a url, then pointing the component at a “local” copy of the RSS file instead of a remote copy might allow it to function. Note that this will still fail even if the file is on a local server if the component requires a url and cannot use a path … it’s reading the url that has the security risk potential (you can’t read a “path” on a remote system), and that is what DH tries to block.

Of course this worked and you did it that way, you would need to repeat the “get and save the RSS file” step periodically in order to have reasonably current RSS feeds available; this is where cron comes in. Cron allows you to automate such things so that you can repeat them at regular intervals or at a certain time.

–rlparker