[thelist] Displaying RSS Feeds on my site
Max Schwanekamp
lists at neptunewebworks.com
Wed Mar 22 11:15:00 CST 2006
Rich Points wrote:
> I've found a bunch of information on how to create and read RSS feeds
> but I haven't found anything on inserting them into html documents. ...
> Can someone tell me if 1) this is possible and 2) if so how can I set
it up?
What you're looking for is called an RSS parser, with support for HTML
output. I've found some useful RSS tools on phpclasses.org. A quick
search just now turns up at least one option[0] as well as some adverts
for tools doing the same. Google can likely give you more options than
you care to look at[1]. If you're using PHP, Magpie is a well-known
option[2], and if you're using Smarty there's a decent plugin for this
too[3] written by Monte Ohrt, one of the lead Smarty devs.
As for the how, basically what you do is instantiate the parser object,
have it connect to and parse the XML that the RSS feed consists of, and
you get an array of feed items. Then you'll iterate over those feed
items to output the HTML, using a foreach or similar construct.
[0] http://www.phpclasses.org/browse/package/2831.html
[1] http://www.google.com/search?q=rss+parser
[2] http://magpierss.sourceforge.net/
[3] http://smarty.incutio.com/?page=RSSLoadPlugin
--
Max Schwanekamp
http://www.neptunewebworks.com/
More information about the thelist
mailing list