What is an RSS Feed?

RSS stands for “really simple syndication” and is basically a special type of XML document. RSS Feeds are generally used to provide content used for syndication across the web, the most common use for RSS was by the news agencies who would provide an RSS feed which other news agencies would use as content for their websites.

Why should we care?

There are many different uses for RSS feeds other than for news syndication, you can use them to post the same content across all the sites you manage for example. If you run a network of websites selling products you can post your special offers across your entire network using RSS. For those of us interested in SEO there may be duplicate content related issues if this is over done.

You can display your latest “blog posts” or “tweets” via an RSS feed . If you wanted to keep adding fresh content to your home page you could set up a widget to pull in your RSS feed directly onto the front page of your site.

You can even use RSS feeds to create back links for your website, lots of back links!

Why code one manually?

This is a strange concept, because if you code them manually it will mean there is a great level of “up keep” needed. If you are running a blog the feed is usually generated for you, all your latest posts are automatically added to the Feed.

This isn’t always ideal, auto generated Feeds can contain posts you don’t want to be freely available to the rest of the world. The are situations when coding by hand is required.

This is basically because you have greater control over what the feed contains, if you wanted a specific message to be displayed across your network of sites on a certain day this method would work fine.

Another use for manually built RSS feeds is if you wanted to convert your website structure into an RSS feed. But why I hear you ask… Because you can create back links to your site pages as I briefly mentioned above.

How to start.

RSS files are written using xml, which is a tag based language similar to XHTML. Each RSS file includes information about a website, providing a title for the document and a description, again similar to XHTML. This information is called an “item”.

Item Tag

Each item contains a TITLE, LINK, and DESCRIPTION. Start by placing the opening <item> tag at the top, then place the closing </item> tag at the bottom, like this:

<item>

</item>

Title Tag

Add the <title> tag, following with the text of your title, then end with the </title> tag. It would look like this:

<item>

     <title>Title Of Your Item</title>
</item>

Link Tag

Next, add your link information, beginning with <link>, following with the actual hyperlink, then closing with </link>, to look like this:

<item>
<title>Title Of Your Item</title>
     <link>http://yourwebsite.co.uk/page.php</link>
</item>

Description Tag

For your description, you start with the opening <description> tag, then following with the actual description, then closing with the </description> tag. Now you have this:

<item>
<title>The Name of Your Story</title>
<link>http://yourwebsite.co.uk/page.php</link>
     <description>Short description of your story</description>
</item>

If you want to add multiple “stories” to your RSS feed, simply replicate the above steps.

Channel Tag

Once you have defined the stories you want to distribute, you need to create a “channel” for them. The channel is usually a description of the entire website not just the page. You will use very similar tags as above, just omit the <item> tags.

The Channel needs a Title, Description and a Link. The Channel information should be placed before your first “Item”.

<channel>
<title>Title Of Your Site</title>
<link>http://yourwebsite.co.uk/</link>
<description>Short description about your website or “channel”.</description>

<item>
<title>The Name of Your Story</title>
<link>http://yourwebsite.co.uk/page.php</link>
<description>Short description of your story</description>
</item>

Define & Declaire

This last section defines the languages you are coding in and declares the version of RSS you are coding. This is similar to how you declair and define an XHTML document.

Add the following to the beginning of your code.

<?xml version=”1.0″?>
<rss version=”2.0″>

The final tag you need to add is the closing </rss> tag.

You should end up with this…

<?xml version=”1.0″?>
<rss version=”2.0″>

<channel>
<title>Title Of Your Site</title>
<link>http://yourwebsite.co.uk/</link>
<description>Short description about your website or “channel”.</description>
<item>
<title>The Name of Your Story</title>
<link>http://yourwebsite.co.uk/page.php</link>
<description>Short description of your story</description>
</item>
</rss>

Thanks for reading.

Andy.

Sharing is caring!