Skip to content

Instantly share code, notes, and snippets.

@swindsor
Created February 7, 2011 16:29
Show Gist options
  • Save swindsor/814665 to your computer and use it in GitHub Desktop.
Save swindsor/814665 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'ruby_odata'
svc = OData::Service.new "http://odata.netflix.com/Catalog/"
puts "DVD:"
svc.Titles.filter("AverageRating le 2 and Type eq 'Movie' and Dvd/Available eq true").order_by("AverageRating asc").top(100)
movies = svc.execute
movies.each_with_index do |movie,i|
puts "#{i.succ}. #{movie.ShortName} (#{movie.ReleaseYear}): #{movie.AverageRating}"
puts "#{movie.Url}"
end
puts "Instant:"
svc.Titles.filter("AverageRating le 2 and Type eq 'Movie' and Instant/Available eq true").order_by("AverageRating asc").top(100)
movies = svc.execute
movies.each_with_index do |movie,i|
puts "#{i.succ}. #{movie.ShortName} (#{movie.ReleaseYear}): #{movie.AverageRating}"
puts "#{movie.Url}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment