次の方法で共有


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: https://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.

48054

Comments