dinsdag, januari 01, 2008
Finally feeds
What are RSS feeds?
A key characteristic of modern 2.0 web sites is that you don't have to visit them every single time to check for new items. The content comes to you via something called RSS feeds. You can subscribe to news items, or get notified when a blogger posts a new article, or when a Flickr member posts a new photo, etc. RSS stands for Really Simple Syndication, and is basically a little file on a web site that lists the latest additions. So the web site has to have this RSS service. You, the user, need to have a little program to see and manage all your subscriptions. Some e-mail clients like Thunderbird have an RSS reader. Browsers such as Firefox and Internet Explorer have build-in capabilities for subscribing to RSS feeds these days. I'm using a free service from Google, called Google Reader to read all the stuff I'm subscribed to. Bloglines is another popular web-based RSS reader.
How to subscribe?
If a site has subscriptions, you will see it via the orange RSS icon. In modern browsers, you will be able to directly subscribe to them by clicking the icon and adding them to your RSS reader. Otherwise you can always copy/paste the URL of the feed manually in your reader.
Firefox shows the RSS button on the right end of the address bar, if a feed is available.

Internet Explorer 7 shows the RSS button next to the home button, but it is only enabled when one or more feeds are available.

RSS feeds in about2findout.com
On the home page and on the main page of the Quiz Zone, there is an automatic feed for new quizzes in English that your browser will detect. On the profile page of a member, there is an automatic feed available and a link to subscribe to all new questions of that member. The feed shows the last 10 additions and has a link to the question or quiz. A central page with direct links to all feeds that are available is here:
http://www.about2findout.com/feeds.aspx
How did I do it?
I used the ASP.NET RSS 2.0 Toolkit to create the feeds. It is a free asp.net component, available on Codeplex. You can find a nice tutorial on ScottGu's blog and on Piyush Shah's blog. What I did in essence was:
1- download the toolkit and sample site from Codeplex
2- add the components to Visual Studio (right click on the toolbar and choose 'select items' and point to the RSS toolkit dll file.
3- create an .ashx handler file, based on the sample in the toolkit that checks the request parameters of the page and creates the feed items based on that
3- add an RssHyperLink component to every page you want to have an automatic feed detection and point it to the .ashx file.
It took me a couple of hours playing with the sample site to figure out how it works, but the components are very good and you get a feed in no time published. I can recommend this toolkit to anyone wanting to publish RSS or atom feeds in an asp.net application.
Labels: about2findout, asp.net rss toolkit, feeds, new, RSS, subscription
