Netflix Rental History Summarizer in Ruby

Though Netflix now gives you the ability to get an RSS feed of your recent rental activity, I wanted to make a catalog of all the titles I’ve rented from Netflix.

So I wrote this Ruby script to parse the full rental activity listing that’s available in https://www.netflix.com/RentalActivity?all=true

Just save this listing as plain HTML and run my script, giving the name of the HTML file as the first argument:

ruby parseRentalHistory.rb RentalActivity.html

This will go out to Netflix to get the synopsis information for each (newly added) movie, then build a summary HTML file and save all the information in a database file for later use.

When you run the script again (with new data, after you’ve rented or rated more movies) the script will only retrieve the synopsis information for the new movies.

Here's an example of the HTML output when viewed in a browser:

screenshot

I've also set up separate styles for printing, so the printed output looks like this:

print sample

It requires the following Ruby modules to be installed:

To install these, you can use gem:

gem install hpricot
gem install curb