I want to grab all of the list of users from my app and make a nice formatted list of them every week, and I was wondering what rails command would grab the source html from a url? Thanks, Ben Lisbakken -- Posted via http://www.ruby-forum.com/.
Ben Lisbakken
2006-Jul-31 03:16 UTC
[Rails] Re: How do you grab the source HTML from a url?
Ben Lisbakken wrote:> I want to grab all of the list of users from my app and make a nice > formatted list of them every week, and I was wondering what rails > command would grab the source html from a url? > > Thanks, > Ben LisbakkenWell, I could just have the app write it directly to a file, but for curiosity sake, how would it be done? -- Posted via http://www.ruby-forum.com/.
Kevin Olbrich
2006-Jul-31 04:19 UTC
[Rails] Re: How do you grab the source HTML from a url?
On Monday, July 31, 2006, at 5:16 AM, Ben Lisbakken wrote:>Ben Lisbakken wrote: >> I want to grab all of the list of users from my app and make a nice >> formatted list of them every week, and I was wondering what rails >> command would grab the source html from a url? >> >> Thanks, >> Ben Lisbakken > >Well, I could just have the app write it directly to a file, but for >curiosity sake, how would it be done? > >-- >Posted via http://www.ruby-forum.com/. >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/railsrequire ''open-uri'' lines=[] open(''http://url/to/parse'') do |f| lines = f.readlines end That should dump the entire thing into an array. There are some libraries to help you parse that mess, but it''s late and I don''t remember which ones they are. _Kevin www.sciwerks.com -- Posted with http://DevLists.com. Sign up and save your mailbox.