Strepi¶ ↑
An updated gem based on Mwhich
INSTALLING STREPI¶ ↑
Strepi can be downloaded with
gem install ‘strepi’
DESCRIPTION¶ ↑
Strepi was made as an update to the now defunct MWhich, which was no longer maintained because of the lack of a Netflix API. I was able to restore Netflix functionality to Strepi and add Crunchyroll(Anime streaming website) service. Strepi checks to see if a movie/TV show is available on ITunes, Amazon, Crunchyroll, Netflix, or Amazon.
HOW IT WAS DONE¶ ↑
This is how the data for each service was acessed
-
Netflix: The Netflix Roulette gem and api. (netflixroulette.net/api/)
-
Amazon: Official Amazon ECS (Required credentials)
-
Hulu: Hacks publisher tool endpoint
-
iTunes: Their Store Web Service Search API via AffiliatesSearch2.1.pdf
-
Crunchyroll: Scrapes Crunchyroll pages
REQUIREMENTS ¶ ↑
Similar to MWhich, these gems are needed:
-
yajl-ruby
-
nokogiri
-
ruby-hmac
USING STREPI¶ ↑
To create a basic Strepi instance:
w = Strepi::Client.new
You can search for a movie like this:
w.search("The Prestige") # => {:amazon=>[], :hulu=>[], :itunes=>["feature-movie: The Prestige ($9.99)"], :netflix=>[The Prestige is available!, :crunchyroll=>[]}
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:
-
Hulu sometimes links to external content, “Not on hulu!” will identify this.
-
iTunes will display prices of product
Limit your searches by service:
w = Strepi::Client.new(:services => [:netflix, :crunchyroll, :hulu]) w.search("Naruto") # => {:netflix=>[], :crunchyroll=>["Naruto is on Crunchyroll!"], :hulu=>[": Naruto", ": (Sub) Departure", ": (Sub) The Ultimate Weapon Reborn", ": (Sub) The Counterattack!", ": (Sub) Sand Alliance with the Leaf Shinobi", ": (Sub) The Targeted Shukaku", ": (Sub) A Past to Be Erased", ": (Sub) Bringing Back Reality", ": (Sub) Vanished Memories", ": (Sub) To Each His Own Path"]}
Enter Amazon credentials:
w = Strepi::Client.new(:services => [:amazon], :ecs_credentials => {:associate_tag => 'Your associate tag', :AWS_access_key_id => 'Your access key ID', :AWS_secret_key => 'Your secret key'})
Amazon credentials can also be stored in initializer and be called as ECS_CREDENTIALS when creating Strepi instance.
Initializer file:
ECS_CREDENTIALS = {:associate_tag => 'Your associate tag', :AWS_access_key_id => 'Your access key ID', :AWS_secret_key => 'Your secret key'}