| about this site | contact | STC's Web site (stc.org) |
![]() |
|
Volume XX |
In this issue....
Features
Administration
Communities
Competitions
Elections
Events
Honors and Awards
STC Conference
Leadership Links
By Brian Flaherty, Senior Member and Webmaster, New York Metro Chapter
It took some time, but I did successfully implement the RSS feed that appears on www.stc.org for the New York Metro Chapter STC Web site. I took the PHP script that Chris Schapman, webmaster of the Southwestern Ohio Chapter STC, originally obtained and tweaked from www.sitepoint.com, “bracketed” it using our site’s style-sheet (HTML and CSS coding), and it worked!
That’s one of the nice things about PHP—you can mix HTML and PHP scripting code. I’m pretty versatile when it comes to Web authoring and managing, and have dabbled in CGI/PERL, Python, and PHP. So adapting Chris’s PHP script to our site wasn’t too difficult for me.
Developing Our Own RSS Feed
After implementing www.stc.org’s RSS feed, I decided to develop one for my own chapter’s site. I researched RSS, copied an .rss example file, tweaked the code, and was able to successfully implement a chapter RSS feed. To view our chapter’s RSS feed, visit stcnymetro.org/rss2.php. (The resulting Web page is the result of the PHP script processing the actual RSS file, stcnymetro.rss. If you have Internet Explorer 7, you can access the actual .rss file and subscribe to the feed!) In this article, I’ll show you how to develop and implement a RSS feed for your community’s Web site.
What is RSS? Depending on the standard and version, RSS can refer to:
The key concept is syndication—a method of promoting updated Web content. RSS files use extensible markup language (XML) to identify the specific Web content to be periodically updated. RSS readers, or aggregators, then render these files to produce the output displayed by the rss2.php file previously mentioned. Users can subscribe to the RSS feed by supplying the feed’s link to their reader or aggregator (you can think of a reader as a browser for RSS files). The reader can then check the user’s subscriber feeds to display any feeds or content that have recently changed. Any recently updated feeds are retrieved and presented to the user. Incidentally, if you have an RSS reader or aggregator, you don’t have to visit the rss2.php script mentioned above; you can access our chapter’s RSS feed directly at www.stcnymetro.org/stcnymetro.rss.
Implementation Steps
To implement a community RSS feed:
Before doing anything, you need to take stock of your site and decide what content you want to syndicate in your RSS feed. To keep my discussion concise, I’ll use my chapter’s RSS feed as an example. As the New York Metro Chapter STC webmaster, after examining my chapter’s hit logs, I decided to develop feeds for the following content:
It’s the last item where RSS really shines, updating content that will change most often in my feed. As event notices are removed and added, RSS readers will alert the user to the changes, and display the content at the user’s request.
Next, we create the RSS feed file. RSS is an XML grammar that is subject to a specific format and layout order, as in this example:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="0.91">
<channel>
<title>New York Metro STC</title>
<link>http://stcnymetro.org/</link>
<description>This is the New York Metro STC RSS feed.</description>
<language>us-en</language>
<copyright>Copyright 2007, New York Metro STC (stcnymetro.org).
All rights reserved.</copyright>
<webMaster>webmaster@stcnymetro.org</webMaster>
<item>
<title>About the STC and New York Metro Chapter</title>
<link>http://stcnymetro.org/join.htm</link>
<description>Learn more about the STC and the New York Metro
Chapter.</description>
</item>
<item>
<title>Breaking into Tech Writing</title>
<link>http://stcnymetro.org/career.htm</link>
<description>How to become a technical writer.</description>
</item>
<item>
<title>Chapter Dinner Meeting, Thursday, Mar-29</title>
<link>http://stcnymetro.org/events/notices/mar292007.htm</link>
<description>Information about the Mar-29 meeting.</description>
</item>
</channel>
</rss>
Please note that this example is a scaled-down version of the actual stcnymetro.rss file. The actual .rss file is much larger, and contains more information. Also, that file conforms to RSS version 0.91 (still a very popular version). So, this article is limited to discussing RSS 0.91. (I’ve excluded discussing the <img> and <textinput> tags. I don’t use them, and I want to save space.)
Finishing Touches
Once you have created your .rss file, you need to test it. Use an RSS reader or aggregator to “subscribe” to the content. Or, use a PHP or CGI script to test it. Free RSS readers are available for Windows from About.Com. The two most popular are Omea Reader and Awasu Personal Edition. New browsers, like Internet Explorer version 7 (IE7), can process RSS feeds and handle the subscription process (as described earlier in this article).
Alternately, you can adapt a PHP or CGI script to process the feed. For example, using Chris Schapman’s STC RSS feed script mentioned earlier, look for the line that begins with $rss_url, and replace the URL after the equal sign (=) with the URL pointing to your RSS feed file:
$rss_url = “http://www.mycompany.com/myrssfile.rss”
When you test the feed file, make sure the results meet your expectations. Correct and tweak the feed file as required, and retest.
One more thing: make sure you make your feed(s) auto-discoverable. To do this, each page on your Web site should include the following within the <head> tag:
<link rel="alternate" type="application/rss+xml" title="rss"A plethora of RSS resources are available on the Web. Some useful resources include Wikipedia, Webopedia, XML.Com, and web.resource.org. Or, just Google “RSS” to learn more.
Author’s note: Thanks to Lou Quillio for the tip about the <link> tag for making my RSS feed auto-discoverable.
Brian Flaherty may be contacted with questions at webmaster@stcnymetro.org.