How to create your own RSS Reader - Introduction



What is RSS?



An xml format used for sharing frequently updated content, blogs, news etc which can be displayed on websites or on someones computer/mobile via a rss reader (and some email client software)

It may contain summary of content, providing links to the actual content, or simply contain the actual content.

Various specifications (or formats) are available, but we're mainly going to be focussing on RSS 2.0 - the code should however work with most rss specifications, except the netscape specification (rdf).

Depending on which specification you use, the abbreviation can mean the following:

Really Simple Syndication (RSS 2.0)
RDF Site Summary (RSS 1.0)
Rich Site Summary (RSS 0.91)


The basics

Here is an example of a basic RSS 2.0 feed.

 
<?xml version="1.0"?>
<rss version="2.0">
  <channel>
 
    <title>Some Rss Feed somewhere</title>
    <link>http://somewebsite.com</link>
    <description>Some of our latest content</description>
 
    <item>
      <title>Some title 1</title>
      <link>http://somewebsite.com/somepage1.html</link>
      <description>Some description about this link</description>
    </item>
 
    <item>
      <title>Some title 2</title>
      <link>http://somewebsite.com/somepage2.html</link>
      <description>Some description about this link</description>
    </item>
 
    <item>
      <title>Some title 3</title>
      <link>http://somewebsite.com/somepage3.html</link>
      <description>Some description about this link</description>
    </item>
 
  </channel>
</rss>
 

Brief description of rss elements

Required channel elements

Element Description
title The title of the feed
link A link on a website relating to the feed
description What the feed is all about
Item Elements containing feed items

Optional channel elements

Element Description
language Language the feed is written in.
copyright Copyright notice for content in the feed.
managingEditor Email address for the editor managing the feed.
webMaster Email address for reporting technical issues
pubDate Publication date for the feed.
lastBuildDate Last time the feed changed.
category Specify categories that the feed belongs to.
generator Text indicating the program used to generate the feed.
cloud Implementing a lightweight publish-subscribe protocol for RSS feeds – which (for example) can be used to let the rss reader know when a new feed is available
ttl ttl(time to live) If you're planning to cache rss feeds, you can use this value (in minutes) to obtain how frequent you need to refresh your cache.
image Sets an image that can be displayed with the channel.
textInput Specifies a text input box that can be displayed with the channel.
skipHours Hours that can be skipped.
skipDays Days that can be skipped

Item elements

Element Description
title Title of the item.
link URL of the item.
description Content of the item
author Email address of the author
category Specify categories that the item belongs to.
comments URL of a page for comments relating to the item.
enclosure Describes an attachment that is attached to the item. It contains three attributes, url (location of the attachment), length (size of the attachment in bytes) and type (Mime type)
guid Unique identifier
pubDate Publication date of the item
source The channel that the item came from.

Image Elements

Element Description
title Description of the image, can be used in the alt attribute of the img (x)html element thats potentially rendered along with the feed
url Location of the image
link Same as the link found in the root of the channel element
width / height Optionally you can supply the rss reader with a width and height tag for the image

For more information on tags or specifications, go to http://feedvalidator.org/




Comments

superb sample

Hi dude, Its really amazing.Good work.I appreciate u..





Post comment

Note that your comment won't appear immediately (it will be moderated)

Name *
Email
Title
Body *
Security code
*
* Required fields

Latest Articles

C# : Snippets


Collection of C# snippets
2010-05-22 01:06:19

MS SQL : Snippets


Collection of MS SQL snippets
2010-05-22 00:55:15

JavaScript : Snippets


Collection of JavaScript snippets
2010-05-22 00:37:57

ASP.net: Snippets


Collection of ASP.net snippets
2010-05-22 00:29:56

PHP: Snippets


Collection of PHP snippets
2010-05-22 00:06:45

Parallel Language Reference : Strings


a Parallel reference of programming languages
2009-09-10 12:48:23

PHP Tutorial: Developing a Login – Part 1


a tutorial explaining how to develop a simple login using PHP and MySQL
2009-09-05 18:26:47

Event driven programming in PHP


An article looking at adding some kind of event driven model to PHP 5
2008-07-28 12:48:09

How to create your own RSS Reader


It is very simple creating your own rss reader, the following article looks at a few methods of doing this.
2008-06-23 13:18:25

Javascript Reference: Dropdown


A quick reference about working with dropdown boxes (select element) in javascript.
2007-02-17 16:36:41

Top 5 Articles

Programming humor


Collection of funny programming articles
2006-10-08 14:23:43

How to create your own RSS Reader


It is very simple creating your own rss reader, the following article looks at a few methods of doing this.
2008-06-23 13:18:25

Javascript Reference: Dropdown


A quick reference about working with dropdown boxes (select element) in javascript.
2007-02-17 16:36:41

Event driven programming in PHP


An article looking at adding some kind of event driven model to PHP 5
2008-07-28 12:48:09

PHP: Snippets


Collection of PHP snippets
2010-05-22 00:06:45