GuideboxWrapper

Guidebox Wrapper is a Ruby Wrapper for the Guidebox API. The Guidebox API contains tons of information about tv shows and movies. This gem will help you extract data from this API in a simple way. It contains an array of different methods that allow you to obtain different information about a movie/tv show.
Installation
Add this line to your application's Gemfile:
gem 'GuideboxWrapper'
And then execute:
$ bundle
Or install it yourself as:
$ gem install GuideboxWrapper
Usage
To use this gem you must first register for a personal API key on Guidebox's website. This registration page can be found here: Guidebox API key registration page. Once you obtain your personal API key (which should be randomized string of numbers and characters) you will be able to start using this gem.
Do not use yet, this Gem is not currently active on RubyGems
The API helpers throughout this gem can be called on either Tv or Movie objects. These objects can be initialized by doing the following:
GuideboxWrapper::GuideboxTv.new("YOUR_API_KEY", "region")
GuideboxWrapper::GuideboxMovie.new("YOUR_API_KEY", "region")
Keep in mind that Guidebox has some restrictions on the amount of API calls that can be made per month and per second. The API is limited to 100,000 API calls a month and 1 API call per second. The monthy limit of 100,000 resets on the 1st of every month. To check the amont of API calls you have made in the current month use the quota helper. It can be called on either a GuideboxWrapper::Movie Or GuideboxWrapper::Tv object as follows:
tv = GuideboxWrapper::GuideboxTv.new("YOUR_API_KEY", "region")
tv.quota
movie = GuideboxWrapper::GuideboxMovie.new("YOUR_API_KEY", "region")
movie.quota
Here are all the helper methods within this wrapper for the Movie and Tv classes:
Movie Helpers
guidebox_movie = GuideboxWrapper::GuideboxMovie.new("YOUR_API_KEY", "region")
guidebox_movie.search_for("star wars a new hope")
guidebox_movie.search_for_by_provider("star wars a new hope", "amazon_prime")
guidebox_movie.search_by_db_id(11, "themoviedb")
guidebox_movie.show_information("star wars a new hope")
guidebox_movie.fetch_movie("star wars a new hope")
guidebox_movie.fetch_movie_by_db_id("tt0076759", "imdb")
Accessbile Movie Attributes
:id, :title, :release_year, :cast, :writers, :directors, :release_date, :rating, :duration, :themoviedb, :imdb,
:rottentomatoes, :alternate_titles, :freebase, :wikipedia_id, :metacritic_link, :overview, :genres, :tags, :facebook_link,
:web_trailers, :ios_trailers, :android_trailers, :free_web_sources, :free_ios_sources, :free_android_sources, :tv_everywhere_web_sources,
:tv_everywhere_ios_sources, :tv_everywhere_android_sources, :subscription_web_sources, :purchase_web_sources, :purchase_ios_sources,
:purchase_android_sources, :posters, :backgrounds, :banners, :thumbnails
These can be easily accessed as follows:
guidebox_movie = GuideboxWrapper::GuideboxMovie.new("YOUR_API_KEY", "region")
movie = guidebox_movie.fetch_movie("star wars a new hope")
movie.title
movie.rating
movie.cast
All Images (posters, backgrounds, banners, thumbnails) must first be set before they can be accessed. Due to the fact that is takes an extra Guidebox query to retrieve all the images, they are not initially set to minimize the amount of required queries. To set the images for a movie object, simply do the following:
movie.images=(<Your API key>)
This will allow you to retrieve the proper values from the following methods:
movie.large_posters
movie.medium_posters
movie.small_posters
movie.xlarge_banners
movie.large_banners
movie.medium_banners
movie.small_banners
movie.xlarge_thumbnails
movie.large_thumbnails
movie.medium_thumbnails
movie.small_thumbnails
Tv Helpers
guidebox_tv = GuideboxWrapper::GuideboxTv.new("YOUR_API_KEY", "region")
guidebox_tv.search_for("entourage")
guidebox_tv.search_for_by_provider("entourage", "hbo")
guidebox_tv.search_by_db_id("tt0387199", "imdb")
guidebox_tv.fetch_tv_show_by_db_id("tt0387199", "imdb")
guidebox_tv.show_information("entourage")
guidebox_tv.fetch_tv_show("entourage")
Accessbile Tv Attributes
:id, :title, :alternative_titles, :status, :first_aired, :network,
:channels, :runtime, :genres, :tags, :cast, :overview, :air_day_of_week,
:air_time, :rating, :imdb_id, :tvdb, :themoviedb, :freebase, :tv_com,
:metacritic, :wikipedia_id, :tvrage, :fanart, :poster, :banner, :url,
:artwork, :social, :seasons, :season_total, :related,
:posters, :banners, :thumbnails, :backgrounds
These can easily be accessed as follows:
guidebox_tv = GuideboxWrapper::GuideboxTv.new("YOUR_API_KEY", "region")
show = guidebox_tv.fetch_movie("entourage")
show.title
show.status
show.rating
All Images (posters, backgrounds, banners, thumbnails), Season Information, Accessible Sources, and Related Shows must first be set before they can be accessed. Due to the fact that is takes an extra Guidebox query to retrieve all the images, they are not initially set to minimize the amount of required queries. To set the images for a movie object, simply do the following:
show.images=(<Your API key>)
show.seasons=(<Your API key>)
show.sources=(<Your API key>)
show.related=(<Your API key>)
This will allow you to retrieve the proper values from the following methods:
show.seasons
show.season_total
show.related
show.posters
show.banners
show.thumbnails
show.backgrounds
show.web_sources
show.ios_sources
show.android_sources
show.free_sources
show.subscription_sources
show.purchase_sources
show.small_artwork
show.medium_artwork
show.large_artwork
show.xlarge_artwork
Development
After checking out the repo, run bin/setup to install dependencies. Then, run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release to create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.
Contributing