I was wondering if anyone on the list is experienced in doing this? It looks like the ruby code language itself has built in functionality for RSS does Rails have it''s own functions related to these? - Jim
On 7/18/05, Jim Jeffers <rails-u78NUfcIof50Y1uG8So6J1aTQe2KTcn/@public.gmane.org> wrote:> I was wondering if anyone on the list is experienced in doing this? > It looks like the ruby code language itself has built in > functionality for RSS does Rails have it''s own functions related to > these?Yes, it''s very easy thanks to being able to use builder based templates. See "Builder" under http://rails.rubyonrails.com/classes/ActionView/Base.html with an example j -- http://johansorensen.com http://theexciter.com
On 7/18/05, Jim Jeffers <rails-u78NUfcIof50Y1uG8So6J1aTQe2KTcn/@public.gmane.org> wrote:> I was wondering if anyone on the list is experienced in doing this? > It looks like the ruby code language itself has built in > functionality for RSS does Rails have it''s own functions related to > these?Generating the RSS feed is really easy, just use builder. Parsing is another matter. RSS is hard, really hard. If I were building something which parsed RSS feeds, I''d probably just use Mark Pilgrim''s Universal Feed Parser (http://www.feedparser.org/). Run feedparser from cron and insert the data into the database. As an example, I publish a full-content feed, with the correct character encoding. But still my stuff doesn''t render correctly. http://www.planetrubyonrails.org/show/feed/51 -- Cheers Koz
Parsing RSS feeds are hard? Not if you use XPath. Check out how Typo parses del.icio.us feeds in 11 lines of code: <http://typo.leetsoft.com/trac/file/tags/release_2_0_6/app/models/aggregations/delicious.rb> Shane On 7/17/05, Michael Koziarski <koziarski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 7/18/05, Jim Jeffers <rails-u78NUfcIof50Y1uG8So6J1aTQe2KTcn/@public.gmane.org> wrote: > > I was wondering if anyone on the list is experienced in doing this? > > It looks like the ruby code language itself has built in > > functionality for RSS does Rails have it''s own functions related to > > these? > > Generating the RSS feed is really easy, just use builder. > > Parsing is another matter. RSS is hard, really hard. If I were > building something which parsed RSS feeds, I''d probably just use Mark > Pilgrim''s Universal Feed Parser (http://www.feedparser.org/). Run > feedparser from cron and insert the data into the database. > > As an example, I publish a full-content feed, with the correct > character encoding. But still my stuff doesn''t render correctly. > > http://www.planetrubyonrails.org/show/feed/51 > > > -- > Cheers > > Koz > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On 7/18/05, Shane Vitarana <shanev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Parsing RSS feeds are hard? Not if you use XPath. Check out how Typo > parses del.icio.us feeds in 11 lines of code:Check out how typo is only supporting 1 of the nine incompatible versions of RSS[1], produced by one application running on one platform. I''m not saying that that''s hard, reading XML from one site is trivial. XML on the web at large is much, much harder. Character encoding, XML vs HTTP (make sure you follow RFC3023), invalid XML generated by some blogging tools etc etc. [1]http://diveintomark.org/archives/2004/02/04/incompatible-rss -- Cheers Koz
The irony of all this is that I thought the whole purpose of this was to make content deliverable in a format that was easy to distribute for other applications to parse... doesn''t all of this trouble defy the main purpose of rss? oh well. On Jul 17, 2005, at 6:40 PM, Michael Koziarski wrote:> On 7/18/05, Shane Vitarana <shanev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >> Parsing RSS feeds are hard? Not if you use XPath. Check out how Typo >> parses del.icio.us feeds in 11 lines of code: >> >> > > > Check out how typo is only supporting 1 of the nine incompatible > versions of RSS[1], produced by one application running on one > platform. I''m not saying that that''s hard, reading XML from one > site is trivial. XML on the web at large is much, much harder. > > Character encoding, XML vs HTTP (make sure you follow RFC3023), > invalid XML generated by some blogging tools etc etc. > > > [1]http://diveintomark.org/archives/2004/02/04/incompatible-rss > > -- > Cheers > > Koz > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > >
Hence, Atom was made. Regards, Tomas Jogin On 7/18/05, Jim Jeffers <rails-u78NUfcIof50Y1uG8So6J1aTQe2KTcn/@public.gmane.org> wrote:> The irony of all this is that I thought the whole purpose of this was > to make content deliverable in a format that was easy to distribute > for other applications to parse... doesn''t all of this trouble defy > the main purpose of rss? oh well. > > On Jul 17, 2005, at 6:40 PM, Michael Koziarski wrote: > > > > On 7/18/05, Shane Vitarana <shanev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > >> Parsing RSS feeds are hard? Not if you use XPath. Check out how Typo > >> parses del.icio.us feeds in 11 lines of code: > >> > >> > > > > > > Check out how typo is only supporting 1 of the nine incompatible > > versions of RSS[1], produced by one application running on one > > platform. I''m not saying that that''s hard, reading XML from one > > site is trivial. XML on the web at large is much, much harder. > > > > Character encoding, XML vs HTTP (make sure you follow RFC3023), > > invalid XML generated by some blogging tools etc etc. > > > > > > [1]http://diveintomark.org/archives/2004/02/04/incompatible-rss > > > > -- > > Cheers > > > > Koz > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Lets not let this turn into a RSS flavor 1 vs. RSS flavor 2 vs. Atom flame war. It has been discussed to death in other forums I''m sure. My point was that any and all flavors of RSS/Atom can be parsed easily with XPath queries in Rails. Shane On 7/18/05, Tomas Jogin <tomasj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hence, Atom was made. > > Regards, > Tomas Jogin > > On 7/18/05, Jim Jeffers <rails-u78NUfcIof50Y1uG8So6J1aTQe2KTcn/@public.gmane.org> wrote: > > The irony of all this is that I thought the whole purpose of this was > > to make content deliverable in a format that was easy to distribute > > for other applications to parse... doesn''t all of this trouble defy > > the main purpose of rss? oh well. > > > > On Jul 17, 2005, at 6:40 PM, Michael Koziarski wrote: > > > > > > > On 7/18/05, Shane Vitarana <shanev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > >> Parsing RSS feeds are hard? Not if you use XPath. Check out how Typo > > >> parses del.icio.us feeds in 11 lines of code: > > >> > > >> > > > > > > > > > Check out how typo is only supporting 1 of the nine incompatible > > > versions of RSS[1], produced by one application running on one > > > platform. I''m not saying that that''s hard, reading XML from one > > > site is trivial. XML on the web at large is much, much harder. > > > > > > Character encoding, XML vs HTTP (make sure you follow RFC3023), > > > invalid XML generated by some blogging tools etc etc. > > > > > > > > > [1]http://diveintomark.org/archives/2004/02/04/incompatible-rss > > > > > > -- > > > Cheers > > > > > > Koz > > > _______________________________________________ > > > Rails mailing list > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On 7/18/05, Shane Vitarana <shanev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Lets not let this turn into a RSS flavor 1 vs. RSS flavor 2 vs. Atom > flame war. It has been discussed to death in other forums I''m sure. > My point was that any and all flavors of RSS/Atom can be parsed easily > with XPath queries in Rails.Unless they aren''t XML compliant. The FeedParser has bozo parsing technology for just that case. I too would take Michael''s suggestion and perform the parsing with a cron job. -- rick http://techno-weenie.net