Wite your own RSS News/Blog aggregator in <100 lines of code

The internet is a great way for people/entities to publish information. An RSS reader is a tool to help funnel only the information that you think is important to you.


You can subscribe to RSS sources (Blogs, news sites, businesses, authors) by choosing a button that says Syndication, RSS, or XML button on their web site.  That leads you to an XML document, which contains recently published items. For example, MSNBC has RSS feeds for things like Top News, Weather, Sports, Health. You can subscribe to my blog with this link: http://blogs.msdn.com/calvin_hsia/Rss.aspx


MSN Search has a new feature that will allow you to get an RSS feed for any search. That means you can subscribe to topics such as “tsunami relief”, “Bill Gates”, or “Space Shuttle.” Then, any time the search results change for that topic, the RSS feed will change.


I’ve been using Intravnews, but it didn’t like the XML from the MSN Search. That inspired me to write my own RSS reader.


How complicated can an RSS reader be?


The sample code can subscribe to any RSS feed. If you leave the 2nd parameter empty then MSN Search is used to create the RSS feed. The code then retrieves the RSS XML and parses through the items. A table is maintained to “remember” which items have already been seen. If it’s a new item, then it’s added to an Outlook folder.


Run the code as often as you like, or make it into a service that will run automatically.


You’ll need to change the MailboxName to your mailbox. All posts go to a folder under “RSS”: the folders are automatically created.





Comments (9)

  1. CalvinH [MS] says:

    i modified the code a little so that the HTML of the link is not retrieved and the HTMLBody of the Outlook message is the RSS item description, so a blog is stripped of any CSS, and any MSN search results appear as returned in the RSS feed.

  2. Randy is using my blog as part of a Demo at the Devcon keynote. He has some Fox code running from Outlook…

  3. Today’s sample shows how to create a web crawler in the background. This crawler starts with a web page,…

  4. ... says:

    mmm.. nice design, I must say..

  5. ... says:

    Chi ha fatto questo? E un buon posto per trovare le informazioni importanti!:)

  6. Jeff Berezin says:

    This is excellent work.  I modified it for my needs (removed the outlook stuff) and added to more try/catch stuff to catch empty descriptions (like in craigslist used car feeds).

    Thanks much.