PDA

View Full Version : How to create a RSS newsfeed reader with PHP


bcarl314
08-26-2003, 02:20 PM
Ok, so I've been googling for a while looking into RSS newsfeeds and I've been able to find out how to create a newsfeed from my site. However, what I would really like to do is read RSS newsfeeds from other sites and incorperate the content into my site.

Ideally, I would like to program my own reader with php, however I can't seem to find any resources on where to start, so I'm going to ask a few questions.

1) Are there any tutorials on programming a RSS newsfeed reader using php.

2) How do I know if a site offers an RSS newsfeed? I'd like to have some relevant content, but also things like the current weather conditions for the visitor based on their login data (from a customer database).

Any help is appreciated.

mordred
09-03-2003, 04:49 AM
1.) I thought I had seen a RSS parsing tutorial at Zend, but Google couldn't help my locating it... nevertheless, this article (http://www.sitepoint.com/article/560) from Sitepoint was found. Nevertheless, there do exist some RSS parser classes which simplify the development of a RSS aggregator tremendously. These two I can recommend:

MappieRSS: http://magpierss.sourceforge.net/
Onyx RSS: http://www.readinged.com/onyx/rss/

2.) There is no real standard for doing this, only a quasi standard called auto-detection. Basically you add the RSS syndication file as a linked resource, similar to CSS files. When you retrieve the page document, you have to look for such a <link> tag pointing to such a RSS resource.

EDIT: At the bottom of this page the syntax for a RSS link is explained: http://www.eevl.ac.uk/rss_primer/#nine
Additionally, see http://diveintomark.org/archives/2002/05/30/rss_autodiscovery and http://www.faganfinder.com/search/rss.shtml#site

Since I developed a beta version of a weblog and an alpha version of an aggregator lately, I have accumulated some (at least for me) helpful bookmarks about RSS/RDF. If you want, I can dump them into this thread.