Archive for December, 2008

More Internet History

I just love these videos.

photo

Weekend walk

It felt really good to get out and walk a couple miles of the Burke-Gilman Trail this weekend with my Wife, Justine – Even though I was not thrilled about getting out of bed.

In case anyone in your family needs help

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

hpricot

sigh, code headaches

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 %>:


(expand for larger)

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.