CyberArmy University | Open Source Institute | CyberArmy Intelligence & Security | CyberArmy Services & Projects

[Library Index]

[View category: Programming] [Discuss Article]

Simplifying RSS

Article is yet to be rated
Author:      Rae
Submitted:      04-Jul-2005 04:42:33
Imported From:      zZine (original author: Rae)


RSS stands for Really Simple Syndication. It allows you to distribute and syndicate web content using a family of XML file formats. This is commonly used by websites and web blogs to distribute headlines. Browsers such as Firefox support RSS feed support.
This article teaches you how to create an RSS feed for your website. All you need is a text editor. Take a look at the following script,
rss version=\"2.0\"
channel

title
My Website
/title

link
http://www.abc.com
/link

description
My Website
/description

item

title
New Feed
/title

description
My first feed
/description

link
http://www.abc.com/xyz.html
/link

/item

/channel
/rss
The first tag
rss
, specifies the RSS version standard you are going to use. I have used '2.0'. Remember, since this script has its roots in XML, we have to use a closing
/rss
tag at the end. The
channel
tag is used to describe your feed, its description and its website URL.

Next comes the most imporant tag,
item
. These tags actually pertain to the headline you want visitors to notice. Every headline has its own
item
tag. The
title
will specify the headline, the
description
will specify a short introduction to the article, and the
link
will provide a hyperlink to the article itself. Remember to keep on deleting old headlines as you keep on adding new ones, lest your feed becomes too heavy.

Other than these basic tags, you can also include some optional tags. If you want a website icon or logo with your feed, include an image field like this,
image
title
My feed
/title

url
http://www.abc.com/picture.gif
/url

link
http://www.abc.com
/link
/image
Now you've got to save the script. Since this is nothing but an XML file, include
?xml version=\"1.0\" encoding=\"utf-8\" ?
as the first line in your document. Now save this file with an XML extension, say something like \"firstfeed.xml\". The final step is to include the following line of code into the header section of your HTML page,
link rel=\"alternate\" type=\"application/rss+xml\" title=\"My Feed\" href=\"http://www.abc.com/firstfeed.xml\"
That's it, that is all you need to make your own RSS feed. Feed readers like RSSOwl and browsers like Firefox will now be able to read the headlines you include in the
item
tag.

This article was originally published by CyberArmy.net in the CyberArmy Library.

You must be logged in to vote on an article

About Us | Privacy Policy | Mission Statement | Help