Giter VIP home page Giter VIP logo

mwhich's Introduction

NOTE: THIS CODE IS NO LONGER MAINTAINED

Netflix shut down their public API. :( Please take a look at www.canistream.it and this Ruby gem for canistream.it API.

MWhich

Because searching Netflix, Amazon, Hulu, and iTunes sucks rocks!

INSTALLATION

If you’ve downloaded this code from the repository or as an archive, just run

rake install

DESCRIPTION

MWhich was created because I’m lazy, and that laziness led to a loss of money. Many times I end up watching on movie on iTunes simply because it is the first place I look, even though had I taken another minute I would have found the same movie available via Netflix Instant Play, or cheaper on Amazon’s Video on Demand service.

API ACCESS

Of course there is no easy standard for accessing this movie data, Tim Berners-Lee’s wishes be damned. Here is how these services are accessed:

REQUIREMENTS

You’ll need the following gems:

  • yajl-ruby

  • nokogiri

  • ruby-hmac

USAGE

This is very bare bones right now:

To create a basic MWhich instance:

m = MWhich::Client.new

Search for a movie:

m.search("The Prestige")
# => {:amazon=>[], :hulu=>[], :itunes=>["feature-movie: The Prestige ($9.99)"], :netflix=>["Movie: The Prestige"]}

At this time, this merely returns a hash of key/value pairs indicating which services the movie or TV show was found on. The value is a simple string with the type of media found and the title. Comments specific to each service may also appear. For example:

  • If available on Netflix Instant Play, “Watch now!” will show up.

  • Hulu sometimes links to external content, “Not on hulu!” will identify this.

  • iTunes prices will be displayed

An array of services can be passed to the MWhich instance to limit the search.

Only want to search Netflix and Hulu?

m = MWhich::Client.new(:services => [:netflix, :hulu])
m.search("Knight Rider")
# => {:hulu=>["episode: I Love the Knight Life", "episode: Knight and the City", "episode: Fly By Knight", "episode: Fight Knight", "episode: Exit Light, Enter Knight", "episode: Knight to King's Pawn", "episode: Day Turns Into Knight", "episode: Don't Stop the Knight", "episode: Knight Fever", "episode: Knight of the Zodiac"], :netflix=>["Series: Knight Rider", "Series: Knight Rider"]}

This is obviously imperfect, but does provide an initial abstracted search.

mwhich's People

Contributors

connor avatar dacort avatar jmooserific avatar josephholsten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mwhich's Issues

Looks out of date

When trying to install, it fails due to a really old (apparently no longer supported) version of nokogiri, one of it's dependancies.

ERROR:  Error installing nokogiri:
    ERROR: Failed to build gem native extension.

extconf.rb:10:in `<main>': Use RbConfig instead of obsolete and deprecated Config.

Amazon Search Broken

Netflix, Hulu tested and working.

  => #<MWhich::Client:0x0000010126a208 @services=[:netflix, :hulu], @ignore=[:clips, :trailers]> 
  ruby-1.9.2-p290 :021 > m.search("Arrested Development")
  => {:netflix=>["Series: Arrested Development"], :hulu=>["episode: Development Arrested", "episode: Exit Strategy", "episode: Family Ties", "episode: Fakin' It!", "episode: S.O.B.S", "episode: Making A Stand", "episode: Prison Break-In", "episode: The Ocean Walker", "episode: Mr. F", "episode: Notapusy"]} 

When I add amazon to the services to search for, it doesn't work:

ruby-1.9.2-p290 :022 > m = MWhich::Client.new(:services => [:netflix, :hulu, :amazon])
 => #<MWhich::Client:0x0000010107e340 @services=[:netflix, :hulu, :amazon], @ignore=[:clips, :trailers]> 
ruby-1.9.2-p290 :023 > m.search("Arrested Development")

The error below is thrown:

NoMethodError: undefined method `gsub' for nil:NilClass
    from /Users/jhart/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/cgi/util.rb:7:in `escape'
    from /Users/jhart/Sites/the_rotten_pirate/vendor/mwhich/amazon.rb:32:in `block in request'
    from /Users/jhart/Sites/the_rotten_pirate/vendor/mwhich/amazon.rb:32:in `map'
    from /Users/jhart/Sites/the_rotten_pirate/vendor/mwhich/amazon.rb:32:in `request'
    from /Users/jhart/Sites/the_rotten_pirate/vendor/mwhich/amazon.rb:11:in `search'
    from /Users/jhart/Sites/the_rotten_pirate/vendor/mwhich/client.rb:27:in `block in search'
    from /Users/jhart/Sites/the_rotten_pirate/vendor/mwhich/client.rb:25:in `each'
    from /Users/jhart/Sites/the_rotten_pirate/vendor/mwhich/client.rb:25:in `search'
    from (irb):23
    from /Users/jhart/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.