Hi folks,

I've recently been messing around with incorporating RSS feeds into
one of my sites and found a very simple, yet powerful implementation
that takes advantage of MagpieRSS (magpierss.sourceforge.net) and the
Smarty template engine (www.smarty.net). If anyone is heading down
this route and doesn't feel like tackling a PHP RSS parser, I highly
recommend you check out this (rather dusty) tutorial:

http://www.webmasterworld.com/forum98/465.htm

The instructions are bare-bones and the posting hasn't been commented
on in a couple of years, but it should get you up and running. A
couple of things I learned in the process were:

1. To limit the number of items in the RSS feed that you wish to
display (as opposed to all of them, which can get quite unruly with a
busy feed) use the section attribute "max" in your Smarty template and
set the value to the number of items you want to display. For example:
{section name=x loop=$items max=4}

2. Make sure you know what format your desired RSS feed is in (RSS vs.
Atom) as you will need to modify your Smarty template variables in
order to display the contents of that particular feed. MagpieRSS will
parse both content constructs correctly, but will maintain the
labeling scheme according to the feed format. For instance the parsed
output of an RSS feed will contain a label called "description"
whereas the Atom feed will be labeled "atom_content". Fortunately, the
PHP code in the example has a debugging feature (line 25) that allows
you to display all of the object and array data parsed by MagpieRSS to
help you see these labels and what type they are.

3. As with any fopen() functionality, you must enable
"allow_url_fopen" in your php.ini file and any php-cgi wrappers should
allow for this as well. There are OBVIOUS security issues at hand here
and you should take whatever precautions you see fit. Don't say I
didn't warn you!

To see my working example, hit my website, LogicalThings.com. The
"Visual Junk Journal" on the right side of the home page is being
populated by the Atom feed (generated by Blogger) from another one of
my sites, NoRelevance.com. I'd be interested in seeing anyone else's
implementation of this.

Regards,
Art
LogicalThings.com

--~--~---------~--~----~------------~-------~--~----~
Our Web site: http://www.RefreshAustin.org/

You received this message because you are subscribed to the Google Groups 
"Refresh Austin" group.

[ Posting ]
To post to this group, send email to [email protected]
Job-related postings should follow 
http://groups.google.com/group/Refresh-Austin/web/refresh-austins-job-posting-guidelines.
We do not accept job posts from recruiters.

[ Unsubscribe ]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

[ More Info ]
For more options, visit this group at 
http://groups.google.com/group/Refresh-Austin
-~----------~----~----~----~------~----~------~--~---

Reply via email to