This post originated from an RSS feed registered with Ruby Buzz
by Red Handed.
Original Post: Hpricot the OhFourth
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Well, here’s a new release of Hpricot: 0.4. This I didn’t expect. Thank the persistent fellows who kept hitting my inbox. They’re cited in the CHANGELOG for sending me all manner of palsied HTML with quoting all askew and tilted.
In fact, did you know that you can give Hpricot a plain text file, say one that has just a few HTML snips in it, and you can alter those snips and then output the page again and it just works like that? This child’s only five weeks old still, so there are still encoding and entity and namespace matters to see to.
To install: gem install hpricot. Win32 and source gems.
What Does One Do With Hpricot?
To learn about using Hpricot, try AnHpricotShowcase, which gives a bunch of common examples.
Christoffer Sawicki’s Feedalizer uses Hpricot to turn plain HTML pages into feeds. See?
WWW::Mechanize trunk now uses Hpricot for its automated browsing.
And Zed’s RFuzz site has some Hpricot sample code, if you’re ready to ditch Net::HTTP for some superior socketry. (See also: RFuzz::Browser!)