How to retreive only Items after a specific date

Nov 17, 2007 at 12:44 AM
Edited Nov 17, 2007 at 8:58 PM
Hi,
I am trying to use this framework and want to know couple of following things

1) Once I retreive the Items from a feed , then next time when I retreive how can I avoid retreiving same items again from the web.

2) What is the use of SQLProviders you have ( with create scripts with tables like RssItem, RssFeed etc )
Is this something we can use to save the retreived items and reload them efficiently etc ?

The situation is when I close the app I am creating and run it again I want to load only new items and load older items from a DB .
Coordinator
Nov 19, 2007 at 4:11 AM
Edited Nov 19, 2007 at 4:12 AM
Jakkamma,

1) You can't avoid retrieving the same items again, but you can avoid downloading the feed unless it has been modified since it was last checked using the built-in HTTP conditional GET support offered by the framework through the Refresh() method on feeds. Another way to reduce the amount of processing that takes place is to use the overloaded static Create method on feeds and supply a SyndicationFeedSettings parameter that explicitly defines the number of items to extract from the retrieved feed data using the RetrievalLimit property.

2) There is currently a base provider class that developers can use to implement there own custom providers, as well as an XML data provider for the current native syndication formats supported by the framework. There was an RSS SQL data provider previously, but it was removed until it could fully support syndication extensions. The SQL database installation script is still included in the framework to provide a starting point for developers who want to use SQL as their back-end data store, and the next major release will have built-in SQL data providers for RSS, Atom, OPML, and RSD. It certainly offers a good place to begin designing your own SQL data store if you do not want to wait for the next major release of the framework.

It sounds like you want to be able to selectively retrieve over HTTP only the feed items that are newer than a certain date-time. While probably not impossible, there is no easy way that comes to mind to request via HTTP that only certain portions or nodes of an XML data source be returned unless the feed publisher has implemented a way to accept a date range and then return only feed items that fall within that date range.

My advice would be to use the framework to retrieve the syndication feed the first time using the Create(Uri) method, and then be sure to cache this instance in such a way that you can retrieve the Header property later when you need to retrieve new feeds items. This way you can just call the Refresh() method to retrieve the feed only if it has been modified since you previously retrieved it, and then filter the items based on their PublicationDate property.

For more information about HTTP conditional GET and RSS, I recommend looking at: http://fishbowl.pastiche.org/2002/10/21/http_conditional_get_for_rss_hackers