personal blog related to technology, coding and publishing.
Archive for December, 2008
In case anyone in your family needs help
Dec 4th
We all have family members that need help with their computers from time to time (some of us may even have clients that need a lot of help, too).
This short video should help anyone that needs to learn how to use a computer for surfing the Internet. Enjoy
sigh, code headaches
Dec 2nd
I’m working on a Rails project right now that needs to scrape Web pages (from a single source), returning hashes/arrays of the content (basically, splitting a table into chunks) for insertion into database tables.
The project requires that I scrape a specific source for restaurant reviews, parse the resulting tables and inject rows into my database tables for each inspection date and the list of inspection details (two tables would be updated: “inspections” and “inspection_results”).
The problem I’m having is with using Hpricot: I can’t seem to figure out how to remove the elements I don’t need (such as blank table rows), and how to further parse down inside the table rows (identifying a row as the inspection date, type, and score vs. the individual detail rows for that dated inspection).
Here’s a little Hpricot code I’ve been using (most of which I’ve hacked apart just trying different things:

The result of this (mind you, I loop using <% @blocks.each do |b| %><table><&= b -%><% end %>:
I’m more than happy to share the source file I’m using, and the resulting table output I have. Just e-mail me or leave a comment here.

