Simple guide for creating an RSS feed
Adding an RSS feed to your website or blog is an easy and effective way to keep your visitors up-to-date with your latest news and posts. This quick guide will show you how to write and publish your own feed.
An RSS feed is an XML (eXtensible Markup Language) file that contains a list of your latest news stories in a format that can be easily read by computers and search engines. There is some discussion as to what RSS stands for, but most people opt for "Really Simple Syndication".
To create your own RSS file all you need is a text editor (eg. Notepad) that will let you save files as plain text and also a means with which to upload your new RSS file to your website.
Basic RSS file template
The following sample XML file can be used to create your new RSS feed. Simply create a new file in your text editor, copy and paste the following code and save the file with a suitable name, making sure you save it as a .xml file (eg. myfeed.xml) You can then alter this RSS file to contain details from your own website and news stories.
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<link>http://www.clikdevelopment.co.uk/blog</link>
<language>en</language>
<description>CLiK WebTalk is a blog about web design and e-commerce techniques, news and related issues.
</description>
<image>
<title>CLiK Development Logo</title>
<link>http://www.clikdevelopment.co.uk</link>
<width>39</width>
<height>39</height>
<item>
<description>This is a brief description about the blog article and will give visitors an idea of the article before they decide to read it.</description>
<pubDate>Fri, 20 Jun 2008 10:29:28 GMT</pubDate>
<link>http://www.clikdevelopment.co.uk/blog/blog-id</link>
<category>Category title 1</category>
<item>
<description>This is a brief description about the blog article and will give visitors an idea of the article before they decide to read it.</description>
<pubDate>Fri, 20 Jun 2008 10:29:28 GMT</pubDate>
<link>http://www.clikdevelopment.co.uk/blog/blog-id2</link>
<category>Category title 1</category>
<category>Category title 2</category>
</rss>
A breakdown of the RSS file
The basic RSS file as shown in the sample above, consists of three main sections; a header, an image (optional) and a list of items (eg. news stories or blog posts).
The header contains the following -
- Title <title>
- Title of your RSS feed or website.
- Link <link>
- The full url that links to your website or news section.
- Language <language>
- The language that your website and feed are in. A full list of codes is shown on this html language codes table.
- Description <description>
- A brief description about what your RSS feed is about.
The optional image is used by some RSS programs to help distinguish your feed from others. Try to keep the image dimensions small for best results.
- Image Url <url>
- The full url of the image.
- Title <title>
- A suitable title for the image.
- Link <link>
- The full url that links to your website or news section.
- Width <width>
- The width (in pixels) of the image.
- Height <height>
- The height (in pixels) of the image.
Following this you can have a list of items <item> which relate individual news stories or posts. The way these are updated and the amount per RSS feed vary between sites. Some prefer to update their feed with completely new items on a monthly basis while others have a maximum number of items and while new posts are appended to the RSS feed, older posts outwith the max number are removed.
An item contains the following elements -
- Title <title>
- Title of the post or news article.
- Description <description>
- A brief description about what the post or article is about.
- Publish Date <pubDate>
- The date and time at which the item was written.
- Link <link>
- The full url that permanently links to the article/post on your website.
- Categories <category>
- Optional list of categories that the item has been assigned to. This can then be used to help filter larger RSS feeds.
Remember to escape special characters
As the RSS file is written in XML you have to make sure that certain characters are in their text form 'escaped', otherwise the XML won't validate and your feed won't work. If you have used any of the following characters when making changes to the sample file then please change them to their 'escaped' variants.
- & (change to &)
- make sure you change all the & that are included in dynamic urls as these are often overlooked.
- " (change to ")
- eg. "This is a quote" would become "This is a quote"
- ' (change to ')
- eg. It's almost finished would become It's almost finished.
- > (change to >)
- Only change the newly inserted text with these, DO NOT change the actual xml tags, eg. <item> would still remain as <item>
- < (change to <)
- Only change the newly inserted text with these, DO NOT change the actual xml tags, eg. <item> would still remain as <item>
Upload and validate
Now that you have created your RSS file you need to upload it and insert it into your website. The first step is to upload your .xml file to your website's server using whatever method you normally use (eg. a FTP program).
Once your file is online you should validate it before inserting it into your website. The simplest way to do this is just to enter the full url of your XML file into your web browser and if the feed is loaded without any errors then it has validated successfully.
To insert the feed into your website, all you need to do is include a link to the XML file somewhere on the page. Many websites and blogs now put quite an emphasis on their RSS feeds and prominent links to these are often at the top of the page.
If your website is written using XHTML then you should also include the following line within your <head> tags and change the title and href to your own title and link to the XML file. This will then enable browsers to auto-detect your feed.
Once you upload your updated website files you have finished and have successfully added a RSS feed to your site!
Firefox 3 is released
Firefox 3 is now available to download and the Mozilla Foundation are aiming to set a Guinness World Record for the amount of downloads in 24 hours.
At the time of writing this, it is still officially Download Day 2008 and they are well on their way to setting a very big download total. This is despite the download servers being overwhelmed at the beginning of the day and actually crashing with too many requests.
You would think that they would have prepared for this, but perhaps this is a sign of Firefox's increasing popularity which has even caught its creators by surprise. The latest version of their browser is certainly going to nibble further into Microsoft's majority share of browser use.
Firefox 3 has been hailed as being the fastest and most secure browser now available. Speed tests certainly show that it loads pages faster than its rivals and is a big improvement over Firefox 2. Memory bugs have also been fixed so the latest version is a far lighter load on your system.
Installing Firefox 3 is easy and all your settings and bookmarks are carried over if you have its predecessor installed already. In terms of looks, it is very similar to Firefox 2 but with some noticeable changes to the back and forward buttons and the address bar.
The new address bar or "Awesome Bar" as its makers refer to it, is one of the most noticeable improvements to the browser. It uses past behaviour to help determine what webpage you want to visit, so by typing in "clik" I was offered a number of suitable options, with the CLiK Development website being top.
This tool bypasses the middle step of search engine results and greatly reduces the amount of keystrokes required to navigate to a webpage, so it will certainly change browsing habits.
As a web developer, the emergence of a new browser that supports the latest standards is always welcomed, but there is the added headache that this is yet another browser added to the list for testing new websites. Due to the fact that many internet users still use old and often antique versions of web browsers this is always going to be an issue.
CLiK WebTalk is a blog about web design and e-commerce techniques, news and related issues.
Latest Posts
- How to add social bookmarks to your website - 15 Aug 2008
- Simple guide for creating an RSS feed - 23 Jun 2008
- Firefox 3 is released - 18 Jun 2008
- Still too early for CSS3 - 23 May 2008
- Limitations of PayPal Website Payments Standard - 09 May 2008
- Free web icons - 25 Apr 2008
Archive
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| 01 | ||||||
| 02 | 03 | 04 | 05 | 06 | 07 | 08 |
| 09 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
