views:

39

answers:

1

As a non-professional programmer, I'm trying to self teach myself a little HTML and javascript. My learning project is a desktop gadget that will retrieve rss items from an rss feed.

I would like an option to toggle so the user of the gadget can decide to display all items or only new items (unread items). It's displaying only the new items that I have a question about.

I realize I have to locally store some kind of data that I can use to compare to the most recent fetch results to see if something is new or not.

What is the typical data that is used in this comparison and is it typically stored in a xml file, or some other kind of file?

Thanks.

+2  A: 

In RSS Specifications, guid element should contain a unique identifier for each item, but not all rss feeds respect that, so you may combine that with a date check.

Suggested Simple Storage:

http://example.com/link/to/file.rss guid abcd-ef-12345678
http://example.ord/some/other.rss date 1283647074

This file contains info on the last item of each rss feed in the gadget, space separated (you can comma-separate them as in .csv files as well), first field is the RSS URL, second is the method used to check last item, either via guid or via pubDate, last is the value to check. In the sample file I put the timestamp instead of the pubDate that arrives, for storage purposes.

aularon
So you would then store locally the guid value. Got it, but is this typically stored in an xml file? or a txt file? or some kind of database file?
Steve H
I edited my post to include a sample (and simple) storage file, take a look.
aularon
Thanks, perfect.
Steve H