Monday, August 27, 2007

Web Syndication with RSS and ATOM

Web Syndication with RSS and ATOM
===========================



Syndication lets sites share information across the Web, making it easy to do things like display headlines from a site or collection of sites. Most of the syndicated feeds are written in RSS, a simple XML vocabulary (in several varieties) for summarizing information about a site. Several popular flavors of RSS are leading the pack, with upstart Atom growing in acceptance

Eg: news feeds you might find in news site, blogs etc.

There are accepted standards for syndication:


1) RSS

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


2) ATOM


Formats:

For RSS 0.91
============


<rss version="0.91">

<channel>

<title>Computer Bapus Post</title>

<link>http://computerbapu.blogspot.com</link>

<description> All computer related discussions</description>

<language>en-us</language>

<image>

<url>http://computerbapu.blogspot.com/myimage.jpg</url>

<title>C# hello world</title>

<link>http://computerbapu.blogspot.com</link>

</image>

<item>

<title>C# hello world</title>

<link>http://computerbapu.blogspot.com</link>

<description>console.writeline("i am good");</description>

</item>

</channel>

</rss>

Explaination :

title
A descriptive title for this channel. This should usually be the same as the content of the HTML element title on your main site page
(maximum length : 100)

link
A URI for the channel. This should be a link to the web site that originates the feed
(maximum length is 500 characters)

description
A description of the channel, usually answering the question "What's this site all about?" Limited to 500 characters.


copyright
Copyright notice for the channel

docs
Documentation for the RSS format used by the channel

lastBuildDate
Last time channel content changed, in RFC 822 format, Sat, 01 Jan 05 00:00:27 PST (see http://www.ietf.org/rfc/rfc822.txt)

managingEditor
Email address of managing editor for the channel

pubDate
Publication date of channel, in RFC 822 format, Sat, 01 Jan 05 00:00:27 PST (see http://www.ietf.org/rfc/rfc822.txt)

rating
Platform for Internet Content Selection (PICS) rating (http://www.w3.org/PICS/)

skipDays
Days to skip reading channel

skipHours
Hours to skip reading channel

textInput
A text input box for the channel, such as a search box (required children include title, description, name, and link)

webMaster
Email address of webmaster for the channel



For RSS 1.0 format
=================


XML API

<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF xmlns="http://purl.org/rss/1.0" xmlns:rdf="http://www.w3.org/1999/02/22

-rdf-syntax-ns#">

<channel rdf:about="http://computerbapu.blogspot.com/computerbapu.rss">

<title>Computer bapu</title>

<link>http://computerbapu.blogspot.com</link>

<description>Computer help</description>

<items>

<rdf:Seq>

<rdf:li rdf:resource="http://computerbapu.blogspot.com/myhelp.html"/>

</rdf:Seq>

</items>

</channel>

<item rdf:about="http://computerbapu.blogspot.com/myhelp.html">

<title>C# snippet for email</title>

<link>http://computerbapu.blogspot.com/email.html</link>

<description>hello world ()...</description>

</item>

</rdf:RDF>



Explaination:

rdf:RDF
The rdf:RDF element from the RDF namespace (http://www.w3.org/1999/02/22-rdf-syntax-ns#) is the document element. This element must have exactly one channel child and one or more item children (these elements are in the default namespace, http://purl.org/rss/1.0). The rdf:about attribute on channel, from the RDF namespace, identifies the feed with a URI.

title
A descriptive title for this channel.

link
A URI for the channel.

description
A description of the channel.

items
Contains the RDF elements Seq and li. The resource attribute on rdf:li contains a URI that identifies an item used later in the document

Two other possible children of channel are image and textinput, which link by means of rdf:resource attributes to other image and textinput elements, optionally used in the document as children of rdf:RDF (i.e., you can have one without the other). The image element links a graphic to the channel and must contain the trio title, link, and url; the textinput element contains a script or form that relates to the site and contains title, link, name, and description elements.


For RSS 2.0 format (quite popular now - successor of rss 0.91.)
===================================================


Example:

<rss version="2.0">

<channel>

<title>computer bapu</title>

<link>http://computerbapu.blogspot.com</link>
<pubDate>Mon, 05 Feb 2007 0:00:01 GMT</pubDate>

<description> computer help</description>


<item>

<title>RSS Help</title>

<link>http://computerbapu.blogspot.com/rsshelp.html</link>

<description>Latest News Feeds....</description>

</item>

<item>

<title>Atom Help</title>

<link>http://computerbapu.blogspot.com/atomhelp.html</link>

<description>Latest RSS News Feeds....</description>

</item>


</channel>

</rss>





Explaination:

Child element of channel:

title
Title of channel
(Required)

link
Link to channel
(Required)

description
Description of channel
(Required)

language
Language code for channel
(optional element)

image
Image that represents the channel (required children url, title, and link; optional children description, width, and height)
(optional element)

copyright
Copyright notice for the channel
(optional element)

managingEditor
Email address of managing editor
(optional element)

webMaster
Email address of webmaster
(optional element)

pubDate
Publication date of channel in RFC 822 format, Sat, 01 Jan 05 00:00:27 PST; though not specified in RFC 822, a four-digit year is allowed (see http://www.ietf.org/rfc/rfc822.txt)
(optional element)

lastBuildDate
Last time channel content changed in RFC 822 format, Sat, 01 Jan 05 00:00:27 PST; though not specified in RFC 822, a four-digit year is allowed (see http://www.ietf.org/rfc/rfc822.txt)
(optional element)

rating

Platform for Internet Content Selection (PICS) rating (http://www.w3.org/PICS/)
(optional element)

docs
Documentation for the RSS format used by channel
(optional element)

textInput
A text input box for the channel, such as a search box (required children include title, description, name, and link)
(optional element)

skipDays
Days to skip reading channel
(optional element)

skipHours
Hours to skip reading channel
(optional element)

category
One or more channel categories
(optional element)

generator
Name of generator program
(optional element)

cloud
Specifies a protocol for publishing and subscribing to feeds
(optional element)

ttl
Time to live in minutes
(optional element)


Child element of item:


title
Title of item

link
Link to item

description
Description of item

author
Email address of author of item (optional element)

category
One or more item categories (optional attribute domain)
(optional element)

comments
URL for comment page for item
(optional element)

enclosure
Describes an object attached to item (required attributes url, length, and type)
(optional element)

guid
Globally unique identifier
(optional element)

pubDate
Publication date in RFC 822 format
(optional element)

source
RSS channel the item came from (required attribute url)
(optional element)


Format of ATOM :
==============


<feed version="0.3" xmlns="http://purl.org/atom/ns#" xml:lang="en">

<title>Computer Bapu</title>

<link rel="alternate" type="text/html"

href="http://computerbapu.blogspot.com/"/>

<author>

<name>Computer Bapu SG</name>

</author>

<tagline>This discusses about computer topics</tagline>

<modified>2007-05-14T08:56:00-01:00</modified>

<entry>

<title>C# snippet</title>

<link rel="alternate" type="text/html"

href="http://computerbapu.blogspot.com/mySnippet.html"/>

<id>http://computerbapu.blogspot.com/mySnippet.html</id>

<issued>2007-04-14T08:56:00-01:00</issued>

<modified>2007-05-14T08:56:00-01:00</modified>

</entry>

</feed>


Title: title of the document. There can be only one title.
link: Link of the resource. There can be multiple links. Type denotes media type.
Author: Author of the resource. There can be one author container within which there can be name, url, email
tagline : feeds description

3 comments:

Anonymous said...

Why leave it at BetFair if federal credit and Own suit "well-disposed competitors" in the casino business organisation, said Bruce Bozsum, chairman of the Mohegan Tribe. [url=http://www.onlinecasinoburger.co.uk/]online casino[/url] http://www.onlinecasinotaste.co.uk/ New players can access their win immediately, which the hunting engines you will in all probability find beneficial strategies to help you win. http://www.tasty-onlinecasino.co.uk/

Anonymous said...

Payday loan credit debt will not be accepted into usual fico scores if you know that yours tend to be such this article Payday loans, one example is, just require your account range, Bad Credit Loans, that you way to meet in advance of he meets an application:

Anonymous said...

In the meantime, if you see a Strike Hot Hot Super Respin feature film, providing you 2 respins that could take your reels with the gorilla's amber. [url=http://www.bvfdpaydayloans.co.uk/]http://ukpaydayloans.blog.co.uk/[/url] payday loans This is certainly a lot higher than my Samsung Products and would Extremely urge Samsung to anybody who is in the grocery store for consumer electronic. http://www.bvfdpaydayloans.co.uk/