Storing RSS feed in the Database

Hello all,

I have a requirement where I need to monitor a RSS feed.Once there
is an update,I need t parse the title and content and store it in my
DB table?
Is this possible? Any ideas?
Would appreciate any help.

Thanks
Rails junkie

On 2/2/07, Rails junkie [email protected] wrote:

Rails junkie
You could use cron and ./script/runner and Hpricot to parse the feed
every-so-often and then simply save data to the DB as changes occur.

Hope this helps.


Zack C.
http://depixelate.com

Rails junkie wrote:

Hello all,

I have a requirement where I need to monitor a RSS feed.Once there
is an update,I need t parse the title and content and store it in my
DB table?
Is this possible? Any ideas?
Would appreciate any help.

Thanks
Rails junkie

Look into FeedTools:

Site: http://sporkmonger.com/projects/feedtools/
Tutorial: http://sporkmonger.com/articles/2005/08/11/tutorial/

I’ve been meaning to get started on something like this but am finishing
up another project. I’d love to know how you go about it.

Shai

Thank you All
This really helps and enough to get me started.

This is how I do it in one of my project that has similar
requirements.
You have two problems
First is to get and parse the rss - trivial

require ‘rss’

path = “B92 biz

rssB92biz = RSS::Parser.parse(path)
rssB92biz.items.each do|item|
puts “====================================================”
puts item.title
puts item.link
puts item.description
puts “====================================================”
end

Second is to determine the uniqueness of rss item. I will use the link
but it’s up to you :slight_smile:
The next is to store the new unique rss item in db witch is like any
other model manipulation.

The interesting part is to make this a background task of your
application.
For that task I have used BackgrounDRb (http://
backgroundrb.rubyforge.org).
I hope that I put you on a right course.
If you need some more details just ask.

Dejan

On Feb 2, 8:48 pm, “Rails junkie” [email protected]

As you suggested, everything worked.
Thank you.
I have one question though.
How Do in limit the RSS feed retrieval to only new ones?
If I parse a url, and run a loop, it has all the feeds on that url. is
there way to restrcit to only updated ones?

Thanks