Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib Uses Rubocop to define a consistent code style
spec
.gitignore
.rspec
Gemfile
Gemfile.lock
README.md Handle search return like activerecord when gathering from a resource
Rakefile
tmdb_easy.gemspec

README.md

TMDB Easy

Simple wrapper for TMDB API.

Installing

Put in your Gemfile:

gem 'tmdb-easy', github: 'brunohenrique/tmdb-easy'

Using

Configure

Specify the API Key (to get one just do a TMDB account):

TmdbEasy::Base.api_key 'my_apy_key'

Movie

## Get a movie by TMDB id
movie = TmdbEasy::Movie.find 550
# => #<TmdbEasy::Movie @attributes=...>

movie.title
# => 'Fight Club'

## Search movie by terms returning full movie objects
movies = TmdbEasy::Movie.search 'fight club'
movies.map(&:title)
# => ['Fight Club', 'Jurassic Fight Club', ...]

Search

# TmdbEasy::Search.fetch terms, resource_type [movie, keyword*, person*, etc*]
search = TmdbEasy::Search.fetch 'fight club', 'movie'
search.results
# => [{"adult"=>false, "backdrop_path"=>"/8uO0gUM8aNqYLs1OsTBQiXu0fEv.jpg", "id"=>550, "original_title"=>"Fight Club", "release_date"=>"1999-10-14", "poster_path"=>"/2lECpi35Hnbpa4y46JX0aY3AWTy.jpg", "popularity"=>13.6327066209895, "title"=>"Fight Club", "vote_average"=>7.5, "vote_count"=>2614},
#     {"adult"=>false, "backdrop_path"=>nil, "id"=>151912, "original_title"=>"Jurassic Fight Club", "release_date"=>"", "poster_path"=>nil, "popularity"=>0.46, "title"=>"Jurassic Fight Club", "vote_average"=>0.0, "vote_count"=>0}, ...]

Contributing

Developing

Testing

rspec

*Not implemented yet

Something went wrong with that request. Please try again.