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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 2/2/07, Rails junkie <ABoxForTheOtherStuff-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 junkieYou 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 Chandler http://depixelate.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 junkieLook 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 = "http://www.b92.net/info/rss/biz.xml" 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 :-) 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" <ABoxForTheOtherSt...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thank you All This really helps and enough to get me started. On Feb 2, 12:28 pm, "dima" <dejan.di...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 = "http://www.b92.net/info/rss/biz.xml" > > 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 :-) > 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" <ABoxForTheOtherSt...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > 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- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 On Feb 2, 12:28 pm, "dima" <dejan.di...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 therss- trivial > > require ''rss'' > > path = "http://www.b92.net/info/rss/biz.xml" > > 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 ofrssitem. I will use the link > but it''s up to you :-) > The next is to store the new uniquerssitem 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" <ABoxForTheOtherSt...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > > > Hello all, > > > I have a requirement where I need to monitor aRSSfeed.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- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---