Introducing the Windows RSS Platform
This topic introduces the Windows RSS Platform, an API that developers can use to manipulate the Common Feed List, the set of feeds to which the user is subscribed. The properties and methods are categorized to provide a technical overview of the platform and its functionality.
This topic contains the following sections.
Introduction
Really Simple Syndication (RSS) is an XML document format used by Web sites to publish frequently updated content, such as news headlines and blog posts. The distribution is called an RSS feed. In most cases, the RSS feed is retrieved directly from a Web server via HTTP. The RSS specification includes conventions that dictate how often feeds should be checked for updates.
As part of the RSS support in Windows Internet Explorer 7, users can discover and subscribe to RSS feeds within the browser. When the user subscribes to a feed, it is added to the Common Feed List, which is available for clients to use in addition to or instead of their own list. For example, in Microsoft Office Outlook® 2007, the user's subscription list can import feeds from the Common Feed List. This enables the discovery of feeds within Internet Explorer, and then for those discovered feeds to appear in other applications.
The Feed Download Engine downloads feeds and merges the new items with the existing data in the feed store. Using the Windows RSS Platform, applications can then expose the feed data to the user. The RSS Explorer of Windows Vista, for example, provides an excellent text reading experience for news and blog feeds, and Microsoft Windows Media Player enables users to listen to audio feeds. The consumption of feed data varies by application; the Windows RSS Platform makes a variety of scenarios possible by providing easy access to the feed data.
Object Model
The top-level object in the Windows RSS Platform is the FeedsManager object. To create the object for scripting, use the ProgID Microsoft.FeedsManager. To create the object for use with C/C++, call CoCreateInstance with CLSID_FeedsManager (defined in the msfeeds.h header file).
The Windows RSS Platform object model hierarchy is as follows:
.gif)
The Windows RSS Platform supports both styles of Component Object Model (COM) interfaces:
- Early-bound (vtable) interface—the interface that is better for C/C++ developers. These objects are in the IXFeedsManager hierarchy.
- Late-bound IDispatch interface—COM Automation interface that is ideal for scripting and managed code (Microsoft Visual Basic .NET and C#). These are the IFeedsManager objects.
To avoid unnecessary repetition, the names of the COM Automation interfaces are used throughout this topic.
Common Feed List
The Common Feed List resembles a hierarchical file system with folders and feeds. The IFeedFolder interface contains properties and methods for accessing feeds contained within the folder as well as properties and methods for accessing subfolders. Because feed folders are mapped to disk directories, folder names are limited to those characters that the file system allows. (See Valid Feed and Folder Names for more information.)
The root folder of the Common Feed List is accessed through the FeedsManager.RootFolder property, which returns an object of type IFeedFolder. From there, each IFeedFolder object contains its own collection of subfolders and feeds. (Refer to the example in Subfolders for a demonstration of a recursive folder search that returns an aggregated total count of feeds.)
The following table lists the methods and properties that are used to traverse and manipulate the Common Feed List hierarchy.
Working with Feeds
The IFeed interface exposes the required and optional elements of an RSS feed. To subscribe to a feed, assign it to a folder. The following table lists the methods and properties that are used to manage the feeds.
RSS 2.0 Elements
Most of the XML elements of an RSS 2.0 feed are available as read-only properties on the associated objects. Although some channel elements (such as cloud, rating, skipDays, and skipHours) are not available as properties on the IFeed interface, they are still in the XML source for the feed. Additional namespace extensions define properties that are used by the Windows RSS Platform to manage lists.
IFeed
The IFeed interface exposes the properties that are present on the RSS channel element.
IFeedItem
Individual items in a feed are represented by FeedItem objects. Depending on the type of feed, these items are aggregated as news items that are merged into the feed, or as list items that replace the contents of the previous list. Additional RSS 2.0 item elements, such as GUID and source, are available in the XML source document of the feed.
IFeedEnclosure
The IFeedEnclosure interface provides access to the optional media file attachment that may be associated with each feed item.
Feed Synchronization
The Internet Explorer 7 aggregator (the Feed Download Engine) automatically downloads the feed items from the source URL specified in the feed. These downloads can occur on a schedule, or as requested by the user. The value of the Interval property and Ttl element of the feed determine how often the feed is downloaded; the feed is updated when the current time is equal to LastDownloadTime plus the maximum of these two values.
The following table lists the methods and properties that control the download and synchronization behavior of feeds:
| Background Synchronization |
|---|
| FeedsManager.AsyncSyncAll | | Forces update of all feeds, regardless of LastDownloadTime or Ttl. |
| FeedsManager.BackgroundSync(action) | | Possible actions are: Enable, Disable, or RunNow. |
| FeedsManager.BackgroundSyncStatus | FEEDS_BACKGROUNDSYNC_STATUS | Returns the status (Disabled, Enabled) of the Feed Download Engine. |
| FeedsManager.DefaultInterval | Integer | Returns, in minutes, the system-defined download interval. |
| FeedsManager.ItemCountLimit | Integer | Returns the upper limit of items that can be kept. |
| Feed.DownloadEnclosuresAutomatically | Boolean | Returns true if enclosures are automatically downloaded with the feed. |
| Feed.Interval | Integer | Returns, in minutes, how frequently the Feed Download Engine should download this feed. |
| Feed.MaxItemCount | Integer | Returns the number of items to keep when downloading this feed. |
| Feed.SyncSetting | FEEDS_SYNC_SETTING | Specifies whether to use the local or global interval setting, or disable automatic download entirely. |
| Feed.Ttl | String | Returns, in minutes, how long the feed should be cached according to the XML of the feed. |
| Download (On Demand) |
|---|
| Feed.Download | | Downloads the feed and merges its contents into the system feed list. |
| FeedEnclosure.AsyncDownload | | Downloads the enclosure. |
| FeedEnclosure.CancelAsyncDownload | | Cancels a download operation in progress. |
| Success Indicators |
|---|
| Feed.LastDownloadTime | Floating-point number | Returns the date and time of the last successful download. |
| FeedItem.LastDownloadTime | Floating-point number | Returns the date and time of the last successful update. |
| Feed.LastDownloadError | FEEDS_DOWNLOAD_ERROR | Returns the download error of the feed, if any. |
| Feed.DownloadStatus | FEEDS_DOWNLOAD_STATUS | Returns the status of the feed. |
| FeedEnclosure.LastDownloadError | FEEDS_DOWNLOAD_ERROR | Returns the download error of the enclosure, if any. |
| FeedEnclosure.DownloadStatus | FEEDS_DOWNLOAD_STATUS | Returns the status of the enclosure. |
Related Topics