Del.Icio.Us Digg Technorati Reddit Stumble Facebook

RSS Auto-Discovery

Posted on 14 Feb 2008 18:47:25 by John Slater in HTML

All new browsers come with built in support for auto-discovery RSS feeds, which means if your site has a RSS feed users are alerted in the address bar. It has been around for several years but with RSS becoming more popular it's time to add auto-discovery to your website.

The code snippet is very simple, simply create either a new document or open a current one. I will use a previous document, after all i must have a website before i have RSS.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>slater.john</title>
</head>
<body>
<p>Hello World!</p>
</body>
</html>

To get started you want to copy the code below and paste it between the <head> tags of your website, i suggest putting it directly below the <title> tag, makes everything neat.

<link rel="alternate" type="application/rss+xml" title="slater.john - Tutorial Updates" href="http://www.slaterjohn.com/rss/tutorials" />

You now want to edit the above code so that it relates to your website. Change the title and href.

Overall it should look like this...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>slater.john</title>
<link rel="alternate" type="application/rss+xml" title="slater.john - Tutorial Updates" href="http://www.slaterjohn.com/rss/tutorials" />
</head>
<body>
<p>Hello World!</p>
</body>
</html>

Once you have done this and opened your file in a new browser such as Firefox you will notice the little orange RSS icon on the right side of the address bar.


Share This Story:
digg del.icio.us Technorati reddit furl stubleupon Facebook