Skip to content

Instantly share code, notes, and snippets.

@aug2uag
Forked from swindsor/worst_movies_odata.rb
Created December 2, 2012 04:51
Show Gist options
  • Save aug2uag/4187011 to your computer and use it in GitHub Desktop.
Save aug2uag/4187011 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