Implementing RSS Feeds

Introduction

RSS feeds have become a common offering of almost any reputable bulletin board, news website, or weblog. As a web developer, RSS feeds are quickly becoming a standard component of any quality web solution. From law firms to mortgage brokers to philanthropies, any site where content is regularly added should include an RSS feed.

What is RSS?

RSS feeds are designed by web developers to make new and updated content easily available to their audience. Information consumers (website visitors) can quickly and easily sign up for an online aggregator or download a desktop aggregator to collect data from multiple feeds. The aggregator, or “feed reader”, compiles the content from these many sources into in a single view. Users may also set specific additional preferences to control the flow of new content from their feeds, like displaying only items with specific keywords. RSS has become an easy way for web publishers to give their content greater reach and provides users an efficient way to track content from a number of online sources without visiting each site directly for new content.

RSS is a family of web feed formats used to broadcast web content. RSS is commonly referred to as “Really Simple Syndication” but also stands for “Rich Site Summary” and “RDF Site Summary.” Regardless of the initialism, they all refer to the syndication of web content. (Wikipedia, n.d.)

To make things a bit more complicated, there are a variety of RSS standards; including RSS 2.0, RSS 0.91, RSS 1.0, RSS 0.92, and RSS 0.90. Furthermore, the numbering schema for RSS does not indicate the release order nor the fundamental differences between the standards. (Ayers & Watt, 2005)

What is important to know with RSS is that there are two primary methodologies when it comes to RSS: those that use Resource Description Framework (RDF) and those that use a simplified syntax. The trade-off between these two methods is that RDF provides richer context information about the items in an RSS feed while the alternative provides easier creation of feeds by developers. RSS 1.0 uses and has become somewhat synonmous with RDF, while RSS 2.0 uses a simplified RSS syntax.

Role of XML in RSS Feeds

XML is the foundation of most RSS feeds and most will be written in well-formed XML. RSS aggregators use XML parsers to process incoming feed information. While it is possible to create an RSS feed without knowledge of XML, and some aggregators will even parse feeds that are not well-formed XML, it is recommended that a cursory knowledge of XML be sought prior to, or in conjunction with RSS feed design. (Ayers & Watt, 2005)

XML is a metalanguage that provides rich detail about content in a way that is both machine-readable and human-readable. When designing a new RSS feed, care must be taken to adhere to the specification for XML 1.0, including XML elements (e.g., channel), attributes (e.g., title), and predefined entities (e.g., >). An RSS feed that is not well-formed XML may be parsed incorrectly by aggregators and could inhibit the dissemination of the content you’re attempting to syndicate.

Designing a Dynamic RSS Feed

The practice of creating a new dynamic RSS feed depends on the scripting language you are using on your site. For our discussion, we will concentrate on creating dynamic RSS feeds with PHP. The content for your RSS feed will generally be stored in a database, thus you will be running a query for the content you wish to syndicate. For experienced PHP/MySQL developers, a simple SQL query based on your SELECT criteria will be used and the RSS file contents will be echoed with the dynamic content embedded.

There is one important step before building the query for your RSS feed. First, you need to force the file type of your RSS feed to be parsed as PHP. This is done in the .htaccess file on your site by adding the file extension to your PHP AddType declaration. For instance, if your RSS file were named newfeed.rss, you would add .rss to the declaration:

AddType application/x-httpd-php .rss

Once your .htaccess file specifies that files with the extension of your RSS feed should be parsed as PHP, you are ready to begin writing your feed. For this step, it is often best to review active feeds from othert sites to understand the framework of an operational feed. You will need to understand the structure for your chosen RSS feed format and echo the appropriate statements that will result in a well-formed RSS feed. For more detailed information on the technical implementation of an RSS feed with PHP, see Creating Dynamic RSS Feeds With PHP on Techdose.com.

Promoting Your New RSS Feed

Once your new RSS feed is operational, you need to find a way to let users know it is available. Promoting your new RSS feed depends highly on the type of information you have included in your feed. For small/medium businesses, the availability of your new feed should be included in company communications including print newsletters and email signatures.

For broad publicity of a new RSS feed, it should be registered with online RSS feed directories. While there are many sites to choose from and the question of which sites are most important for registrations is an ongoing debate, Syndic8.com is one of the longest running directories for RSS feed discovery. Syndic8.com was launched in 2001 by Jeff Barr and provides nearly 500,000 syndicated feeds, with another 1.3 million awaiting syndication at the time of this article. (Syndic8.com, n.d.)

References

Ayers, D. & Watt, A. (2005). Beginning RSS and Atom Programming. Indianapolis: Wiley Publishing.

Syndic8.com. (n.d.) About Syndic8.com. Retrieved January 21, 2007, from http://www.syndic8.com/about.php

Wikipedia. (n.d.) RSS (file format). Retrieved January 21, 2007, from http://en.wikipedia.org/wiki/RSS

Tags:
If you like this post and would like to receive updates from this blog, please subscribe our feed. Subscribe via RSS

Leave a Reply