Control Your Feeds with Windows Vista’s New RSS Platform

Control Your Feeds with Windows Vista’s New RSS Platform

eally Simple Syndication (RSS) is a set of XML schema that define how providers can publish information destined for consumers. In its most common form, RSS holds the text and pictures you find on someone’s blog, but RSS can just as easily contain news headlines or multimedia files attached to a description. As the name implies, RSS is a simple set of standardized XML tags.

Unfortunately, RSS isn’t all that “standardized.” The term really covers a group of formats that have developed over time. The two most common formats are RSS 2.0 and Atom 0.3. But the good news for developers is that Microsoft’s new RSS support in Windows Vista handles not only these (and earlier versions of the RSS spec), but looking forward, Microsoft has promised support for Atom 1.0 when it is released. The bottom line is that Vista developers don’t have to worry about RSS formats?the Vista RSS API takes care of that for you transparently.

Windows Vista adds RSS support at the operating system level, allowing any application direct access to a common application programming interface (API) for reading and manipulating RSS feeds. Making RSS a first-class citizen of the operating system also gives applications direct access to other functionality, such as the Background Intelligent Transfer Service (BITS), for downloading.

The Windows RSS Platform API encapsulates three main components: Common Feed List, Feed Synchronization Engine, and Feed Store. Each provides functionality used by other programs, such as Internet Explorer 7 and Microsoft Outlook. While there are overlaps in some of the capabilities, the idea is to try to keep things common where it makes sense?such as your feed subscriptions.

Here’s what the Windows RSS Platform provides for developers (from the IE team blog):

  • Support for every major RSS and Atom format, as well as many popular extensions.
  • Background scheduled updates.
  • Support for server-friendly technologies such as conditional GETs and RFC 3229 for feeds.
  • Bandwidth-friendly enclosure downloads using BITS.
  • API exposing a simple object model for feeds as well as direct access to the raw XML stream.

Information on the Windows RSS Platform is still marked preliminary on MSDN. Other good sources of information include the RSS team and IE team blogs.

The RSS Object Model
The FeedsManager object is the top-level entity you deal with to access underlying feeds. If you’ve used any type of RSS reader, you’re probably familiar with the concept of arranging your feeds in groups by some common interest. Many readers, including the one in IE 7, let you create folders to group feeds. The Common Feed List supports the concept of hierarchical folders; each folder can contain feeds or other lower-level folders.

Figure 1. Source, Microsoft: MSDN Object Model for the RSS Platform: The FeedsManager is the top-level object. It has a collection of FeedFolders, each of which can contain feeds or other folders.

Within the folders a Feed object contains a collection of items including feed and channel properties. This approach provides feed information through Feed object properties, but if necessary you can access the raw feed XML and deal with it programmatically instead. The FeedItem object has individual item properties such as a read/unread property along with the actual enclosure. The FeedEnclosure object exposes enclosure properties including the local path where enclosures reside in the file system.

The MSDN documentation depicts the object model as shown in Figure 1.

Getting Started with RSS
Here’s the code for a simple VB.NET program that uses RSS Platform API methods to display all the subscribed feeds from the Common Feeds List in a list box when users click a button:

   Imports Microsoft.Feeds.Interop   Public Class Form1      Private Sub Button1_Click(ByVal sender As System.Object,          ByVal e As System.EventArgs)            Dim root As IFeedFolder         Dim manager As New FeedsManager            root = manager.RootFolder         For Each feed As IFeed In root.Feeds            ListBox1.Items.Add(feed.Name)         Next      End Sub   End Class

Here’s the equivalent version in C#:

Figure 2. Feed Object Properties and Methods: Here’s an Intellisense popup showing the methods and properties for the Feed object.
   using Microsoft.Feeds.Interop;   public class Form1 {       private void Button1_Click(          object sender, System.EventArgs e)       {           IFeedFolder root;           FeedsManager manager = new FeedsManager();           root = manager.RootFolder;           foreach (IFeed feed in root.Feeds) {               ListBox1.Items.Add(feed.Name);           }       }   }
Author’s Note: Special thanks to Microsoft’s Mike Taulty for his help with the code in this article.

The preceding code examples use two RSS API objects: IFeedFolder and FeedManager. These two together provide access to the Common Feed List. The nice part about IFeedFolder is that you can iterate over it to walk through the data. Note the syntax of the For Each loop.

You can use the Intellisense feature of Microsoft Visual Studio to look at the different methods and properties of the feed object. Figure 2 shows a partial list of the methods and properties as shown in the Intellisense popup for the Feed object.

Simple List Extensions
Microsoft announced a contribution to the world of RSS last year to deal with lists of things. They called it Simple List Extensions and released it under the Creative Commons License Attribution?ShareAlike license. That basically means you can do with it whatever you want as long as you attribute it to Microsoft and share your results.

The “Amazon Wish List” is a great example. This is a simple list of items available from Amazon that you’d like to have. Although you can’t directly subscribe to a public list using RSS, there is a way to get there?you just have to sign up for a free subscription ID that lets you access Amazon’s Web services API. After getting your ID, you need only obtain the ListID to which you want to subscribe. With that in hand, it would be pretty simple to (for example) build a birthday gift application for friends and relatives that lets people buy presents for them based on their Amazon Wish List items.

Another great example is eBay auctions. eBay makes it possible to subscribe to any of their auction categories with a simple URL that looks something like this:

   http://rss.api.ebay.com/ws/rssapi?FeedName=StoreItems&      siteId=0&language=en-US&output=RSS20&storeId=61961464

Using an auction category URL, you can build an application that receives new auction items in that category via an RSS feed?without having to directly access the eBay site via your browser. After you’ve subscribed to a feed, the Windows Vista RSS Platform takes care of all the downloading and updating for you.

RSS Events
The RSS Platform API also has an event system built right in. RSS events fall into two basic categories: feed events and folder events. These events fire when a feed or folder is deleted or renamed, or when the feed URL has changed or moved. The platform also raises events when a feed starts or finishes downloading, or when the number of items in the feed changes. Finally, there’s an error event raised whenever any type of feed error occurs.

To use an RSS event to trigger some other action, you simply register an event handler to deal with the event?in the same way you register event handlers to deal with mouse clicks on a button, for example. You don’t have to handle every event; you only need to hook up to events of interest. Using the Common Feed List it’s possible to configure individual feeds to trigger events of interest. You can do that either through code or (in limited ways) by using IE7 to access the feed and set its properties.

To handle most events, you need to add the handler by writing a little code. For example, the following VB.NET code snippet adds a handler named FeedRenamed that fires whenever you rename any feed:

   Dim root As IFeedFolder   Dim manager As New FeedsManager   root = manager.RootFolder   For Each feed As IFeed In root.Feeds      Dim events As IFeedEvents_Event =  _         feed.GetWatcher(FEEDS_EVENTS_SCOPE.FES_ALL, _         FEEDS_EVENTS_MASK.FEM_FEEDEVENTS)      AddHandler events.FeedRenamed, _      AddressOf FeedRenamed   Next

And here’s the equivalent code in C#:

   IFeedFolder root;   FeedsManager manager = new FeedsManager();   root = manager.RootFolder;   foreach (IFeed feed in root.Feeds) {      IFeedEvents_Event events =          feed.GetWatcher(         FEEDS_EVENTS_SCOPE.FES_ALL,          FEEDS_EVENTS_MASK.FEM_FEEDEVENTS);      events.FeedRenamed += new System.EventHandler(         this.FeedRenamed);   }

The preceding examples attach handlers for all feeds. To add a handler for a specific feed you simply change the scope from FES_ALL to FES_SELF_ONLY. The API lets you attach events to folders or feeds or both if you’d like. Earlier, I mentioned that you can also add handlers in limited ways via IE7. Microsoft has a new IE7 add-on called “Feeds Plus” that pops up a notifier in your system tray whenever there are new items to read. Feeds Plus basically attaches an event handler to all (or selected) feeds and pops up the notifier whenever the feed updates.

Ideas for Using RSS
Photo blogs have been suggested as another good candidate for additional coding. You probably don’t want to download every last photo from a particular feed, but you might want to get photos that reference some item or topic of interest. You might also want to grab everything from a particular photographer.

Calendar lists are an obvious good choice for a subscription model. While the iCal and ICS format have the lion’s share of this functionality, there’s still room for another option. Corporate information including management info could make good use of RSS as a distributed model.

RSS was originally envisioned as a way to easily push content from one place to another. Although RSS was first widely used for blogs, it has developed into a much more generic vision. Vista takes RSS to another level with OS-level support, letting you build RSS-enabled applications as easily as you can build Windows Forms programs.

devx-admin

devx-admin

Share the Post:
Savings Extravaganza

Big Deal Days Extravaganza

The highly awaited Big Deal Days event for October 2023 is nearly here, scheduled for the 10th and 11th. Similar to the previous year, this

Remote Learning

Revolutionizing Remote Learning for Success

School districts are preparing to reveal a substantial technological upgrade designed to significantly improve remote learning experiences for both educators and students amid the ongoing

Revolutionary SABERS Transforming

SABERS Batteries Transforming Industries

Scientists John Connell and Yi Lin from NASA’s Solid-state Architecture Batteries for Enhanced Rechargeability and Safety (SABERS) project are working on experimental solid-state battery packs

Savings Extravaganza

Big Deal Days Extravaganza

The highly awaited Big Deal Days event for October 2023 is nearly here, scheduled for the 10th and 11th. Similar to the previous year, this autumn sale has already created

Cisco Splunk Deal

Cisco Splunk Deal Sparks Tech Acquisition Frenzy

Cisco’s recent massive purchase of Splunk, an AI-powered cybersecurity firm, for $28 billion signals a potential boost in tech deals after a year of subdued mergers and acquisitions in the

Iran Drone Expansion

Iran’s Jet-Propelled Drone Reshapes Power Balance

Iran has recently unveiled a jet-propelled variant of its Shahed series drone, marking a significant advancement in the nation’s drone technology. The new drone is poised to reshape the regional

Solar Geoengineering

Did the Overshoot Commission Shoot Down Geoengineering?

The Overshoot Commission has recently released a comprehensive report that discusses the controversial topic of Solar Geoengineering, also known as Solar Radiation Modification (SRM). The Commission’s primary objective is to

Remote Learning

Revolutionizing Remote Learning for Success

School districts are preparing to reveal a substantial technological upgrade designed to significantly improve remote learning experiences for both educators and students amid the ongoing pandemic. This major investment, which

Revolutionary SABERS Transforming

SABERS Batteries Transforming Industries

Scientists John Connell and Yi Lin from NASA’s Solid-state Architecture Batteries for Enhanced Rechargeability and Safety (SABERS) project are working on experimental solid-state battery packs that could dramatically change the

Build a Website

How Much Does It Cost to Build a Website?

Are you wondering how much it costs to build a website? The approximated cost is based on several factors, including which add-ons and platforms you choose. For example, a self-hosted

Battery Investments

Battery Startups Attract Billion-Dollar Investments

In recent times, battery startups have experienced a significant boost in investments, with three businesses obtaining over $1 billion in funding within the last month. French company Verkor amassed $2.1

Copilot Revolution

Microsoft Copilot: A Suit of AI Features

Microsoft’s latest offering, Microsoft Copilot, aims to revolutionize the way we interact with technology. By integrating various AI capabilities, this all-in-one tool provides users with an improved experience that not

AI Girlfriend Craze

AI Girlfriend Craze Threatens Relationships

The surge in virtual AI girlfriends’ popularity is playing a role in the escalating issue of loneliness among young males, and this could have serious repercussions for America’s future. A

AIOps Innovations

Senser is Changing AIOps

Senser, an AIOps platform based in Tel Aviv, has introduced its groundbreaking AI-powered observability solution to support developers and operations teams in promptly pinpointing the root causes of service disruptions

Bebop Charging Stations

Check Out The New Bebob Battery Charging Stations

Bebob has introduced new 4- and 8-channel battery charging stations primarily aimed at rental companies, providing a convenient solution for clients with a large quantity of batteries. These wall-mountable and

Malyasian Networks

Malaysia’s Dual 5G Network Growth

On Wednesday, Malaysia’s Prime Minister Anwar Ibrahim announced the country’s plan to implement a dual 5G network strategy. This move is designed to achieve a more equitable incorporation of both

Advanced Drones Race

Pentagon’s Bold Race for Advanced Drones

The Pentagon has recently unveiled its ambitious strategy to acquire thousands of sophisticated drones within the next two years. This decision comes in response to Russia’s rapid utilization of airborne

Important Updates

You Need to See the New Microsoft Updates

Microsoft has recently announced a series of new features and updates across their applications, including Outlook, Microsoft Teams, and SharePoint. These new developments are centered around improving user experience, streamlining

Price Wars

Inside Hyundai and Kia’s Price Wars

South Korean automakers Hyundai and Kia are cutting the prices on a number of their electric vehicles (EVs) in response to growing price competition within the South Korean market. Many

Solar Frenzy Surprises

Solar Subsidy in Germany Causes Frenzy

In a shocking turn of events, the German national KfW bank was forced to discontinue its home solar power subsidy program for charging electric vehicles (EVs) after just one day,

Electric Spare

Electric Cars Ditch Spare Tires for Efficiency

Ira Newlander from West Los Angeles is thinking about trading in his old Ford Explorer for a contemporary hybrid or electric vehicle. However, he has observed that the majority of

Solar Geoengineering Impacts

Unraveling Solar Geoengineering’s Hidden Impacts

As we continue to face the repercussions of climate change, scientists and experts seek innovative ways to mitigate its impacts. Solar geoengineering (SG), a technique involving the distribution of aerosols

Razer Discount

Unbelievable Razer Blade 17 Discount

On September 24, 2023, it was reported that Razer, a popular brand in the premium gaming laptop industry, is offering an exceptional deal on their Razer Blade 17 model. Typically

Innovation Ignition

New Fintech Innovation Ignites Change

The fintech sector continues to attract substantial interest, as demonstrated by a dedicated fintech stage at a recent event featuring panel discussions and informal conversations with industry professionals. The gathering,

Import Easing

Easing Import Rules for Big Tech

India has chosen to ease its proposed restrictions on imports of laptops, tablets, and other IT hardware, allowing manufacturers like Apple Inc., HP Inc., and Dell Technologies Inc. more time

Semiconductor Stock Plummet

Dramatic Downturn in Semiconductor Stocks Looms

Recent events show that the S&P Semiconductors Select Industry Index seems to be experiencing a downturn, which could result in a decline in semiconductor stocks. Known as a key indicator

Anthropic Investment

Amazon’s Bold Anthropic Investment

On Monday, Amazon announced its plan to invest up to $4 billion in the AI firm Anthropic, acquiring a minority stake in the process. This decision demonstrates Amazon’s commitment to