Does anybody know of a script that would fetch the date of the most recent article of an rss feed. And then change the class of an object depending on how many days ago that most recent article was published?

I know very very little about javascript, but I would like to learn, so if you could include explanations along with code, I would appreciate that greatly.