Hints And Tips research knowledge archive
Tip# 271
Sponsored Links
 
Subject: Adding an RSS feed to your site - Beginners Tip
Updated: Nov-15-2004
Rating: Not Rated
By: Rocky Moore - Member #: 1
Location: Klamath Falls, Oregon USA
Website: www.ReflectedThought.com
Category: Computers > Programming > General Web Development
Rate This Tip (10=Great):  1  2  3  4  5  6  7  8  9  10
20 acers ~ log home ~ only $799,000
Until just a week ago, I was totally void of RSS/XML feeds.  Back about a year or two ago, I played with an RSS client program for a couple days.  Did not seem to hold a lot of interest.  This last week, I looked into adding an RSS feed to some of my sites and found that it is VERY useful in today's world and I will probably never be without an RSS client again.

Just the blogs and news feeds that are around make the RSS client worth using, but now there are many web sites providing RSS feeds that notify you about their changes.  No longer will I bookmark those sites and simply forget about them.  I put their RSS feed in my client and when the update, I know it and have the opportunity to go visit them again.  Works great!  I am currently using the SharpReader RSS Client.

To the meat:

To provide an RSS feed that others can use to follow your updates, you only need to add one XML to your web site or generate the file on the fly to keep your updates current automatically.  For several of my sites I use ASP.NET/C# to dynamically build the RSS feed file, but for one of them, I use a file like the one below that I manually edit (not a big task if updates are not frequent).

You only need to change the key fields in the file below and then post it to your web site to provide an RSS feed (on one site I simply call the file rss.xml and locate it in the root directory of the web site).  While most of the fields will appear self explanatory, a few needs more details.

NOTE: it is important with some tags to keep case as it is below.  Also note, that all dates MUST be specified in the RFC 822 format such as in the example.

The Title, Link, Description, Language and Copyright tags all are just what they say.  Items are a group in the list that will be displayed.  You can also nest items.  An example would be a blog where you would have the blog items and nested in each blog item may be the list of comment items.

Category - This is up to you.  It helps to categories your feed

ttl  - This is how long in minutes a client should expect possible updates to the file.  I have it set in the sample below to one 24-hour period.

pubDate - The date / time of the file is published.

lastBuildDate - This is the date / time any of the items actually changed.

guid - This is an id that will uniquely identify the item (I just use the unique URL)

That is pretty much it.  There are quite a number of other options, but these will at least get you going.  For the RSS 2.0 specs you can go to http://blogs.law.harvard.edu/tech/rss

To make it easy for a person to add your site updates to their RSS reader, it is typical to add a little orange button with XML or RSS on it.  You can simple copy the one from here (right click on the XML image and click to save it to your machine).  To make some browser aware that the site has an RSS feed you can use the following link in the head section of your web pages to specify the RSS feed availability.

<link rel="alternate" type="application/rss+xml" title="My Super Site Updates" href="http://www.MySuperSite.com/Rss.xml" />

The other nice thing about the above link, is with the Mozilla FireFox browser, it will display an orange tag in the browser status bar that when someone clicks on it, will automatically add the feed to their "Live Bookmarks" (I prefer using a separate RSS reader though).

Yahoo is providing a new "my.yahoo.com" service that allows a person to display up to 50 RSS sites on the individual's My.Yahoo.com home page.  You can add a button on your site that will allow them to add your site to their list but simply clicking on it.  Here is their link for how to do that (really simple) http://my.yahoo.com/s/faq/rss/publishers.html

Once you have your feed ready for people to use, you should validate it to make sure there are no errors.  I use: http://feedvalidator.org/

After it is validate and you are ready, you can add your feed to large indexes such as:

http://www.syndic8.com
http://feedster.com
http://chordata.geckotribe.com<link>
<link>http://www.terrar.com

http://http://www.faganfinder.com/blogs/

There are many more, but this should get you going!

Sample:

<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>My Super Site</title>
  <link >http://www.MySuperSite.com</link >
  <description>This is the description of my super site!</description>
  <language>en-us</language>
  <pubDate>Sun, 14 Nov 2004 18:00:00 GMT</pubDate>
  <lastBuildDate>Thu, 11 Nov 2004 12:00:00 GMT</lastBuildDate>
  <copyright>Copyright &amp;amp;copy; 2004 My Super Site Company, All rights reserved</copyright>
  <docs>http://www.MySuperSite.com</docs>
  <generator>ByHand</generator>
  <category>Super Sites</category>
  <ttl>1440</ttl>

  <item>
   <title>Building a super site</title>
   <link >http://mysupersite.com/articles/HowtobuildASuperSite.htm</link >
   <guid>http://mysupersite.com/articles/HowtobuildASuperSite.htm</guid>
   <category>How To Articles</category>
   <description>This is an article on how to build a super site</description>
   <pubDate>Thu, 11 Nov 2004 12:00:00 GMT</pubDate>
  </item>

  <item>
   <title>How to Promote a Super Site</title>
   <link >http://mysupersite.com/articles/howtopromte.htm</link >
   <guid>http://mysupersite.com/articles/howtopromte.htm</guid>
   <category>How To Articles</category>
   <description>This is a quick sample of how to promote a Super Site</description>
   <pubDate>Tue, 2 Nov 2004 18:50:00 GMT</pubDate>
  </item>


</channel>
</rss>



[Submit DIGG for this tip]


-----------
Note: Use the tips posted on this site at your own risk. The tips are posted by the public and as such may or may not be valid.

Sponsored Links
Categories
hints and tips gold divider
Sponsor Sites To Visit
The Awakening
Spirit-Filled Christianity is
more than filling a pew !

Not producing fruit?
Healing, where to turn?
Provision, where to turn?
Lost, where to turn?

It is time for --TheAwakening !
The Saints In Light
Christian Thoughts on
Various Topics - Check it Out!

Click Here
Local Christians
Find other Christians
In your local area
Who share your beliefs!

Click Here
United Christian Voters
Tired of seeing your
Rights Vanish?
If all Christians would
Pull together, we can
bring Change Unite Now!

Click Here
Reflected Thought
Inventions ~ Ideas ~ Humor
Politics ~ Opinions ~ Thoughts
Software Development
Business And Stuff....

Click Here
XML RSS News Feed For Recently Posted Hints And Tips  RSS Feed
You can now get updates to the Recent Tips section by using RSS. The address is:

HintsAndTips.com/Rss.aspx

* Posting Tips *
To post a Tip, Recommendation or Tips Wanted, simply browse to the category you feel is a best fit for your post (click on the Recommention or Tips Wanted tab if fitting) and then click on "New Post" option.
(C) Copyright 1998-2009 All Rights Reserved By R & J Technologies - www.RJSoft.com