Saturday, November 04, 2006

RSS feed

First thought building RSS is the complicated work.
After a little work on it, I found that it is pretty simple and cool.

1. All about XML
RSS feed is a XML file. Anyone can simply write a XML file in RSS standard, it will become a feed.

2. Choose a RSS version.
There are many different version. Still need time to merge different standards.
Anyway, RSS 2.0 is a simple one and easy to understand.

3. Create a RSS feed
Use any tool to generate a xml file like:

<rss version="2.0">

    <channel>
        <title>Allan's Blogger</title>
        <link>http://allanxu.blogspot.com
        <description>Allan's blogger feed </description>
        <language>en-ca</language>
        <image>
            <title>Logo</title>  
            <url>http://my.com/logo.gif</url>
            <link>http://allanxu.blogspot.com</link>
        </image>

        <item>
             <title>Hello world</title>  
            <link>http://allanxu.blogspot.com</link>
            <description> Hello ! </description>
        </item>

    </channel>
</rss>

If you need value pairs inside the URL link, use escape characters. like & to replace "&". Otherwise, most feed reader wont parse it properly.

4. Publish
Deploy your page on your server. Well, yes, we need a server.
Record the link.

5. Test
Download a few RSS readers, to add your RSS feed link.
Or use IE/Firefox to open it.
Note: Firefox 2.0 has the function to render the RSS.
IE/Firefox 1.x only display the xml content.
To solve this problem, we can define a xsl to translate it. Or just open any other RSS feed, and copy their xsl link, if there is any.

No comments:

Post a Comment