Using newsfeeds to display your own data on your website
by ZetaGecko | Add Your Comments | Atom/RSS, CaRP, Web Design
Ever since I built CaRP to import news onto one of my websites (I wanted a way to keep it fresh without having to do any work myself), I've been using RSS feeds more and more to shuttle data around my sites. I added code to output RSS feeds from my discussion forums. I set up a press release newsfeed. I setup a newsfeed to which visitors to one of my sites could submit related news. And CaRP displays it all. There are some places on my sites where a particular page pulls the data out of the database and displays it itself, but why write the code to make that happen when a newsfeed will do just as well?
When I add a feature like news, a forum, etc., to one of my sites the database for that feature is structured in a way that makes sense for that feature. For news, there's a headline, a link, and a summary. For a forum, there's a title, a message and an author. (There are other fields, of course, but these are the core). Since the names and types of the fields are different, I can't easily write generic code to access each of the databases and display their content. But If each feature includes code to generate an RSS version of its data, then all I need is an RSS parser to display any of them.