TMDBY : a Ruby wrapper for the TMDB API
- Full integration of all the TMDB API
Add this line to your application's Gemfile:
gem 'tmdby'
And then execute:
$ bundle
Or install it yourself as:
$ gem install tmdby
Every API is encapsulated in its own ruby class. For example, the Movie API is in lib/wrappers/movie.rb
Configuration
Set up your api key :
Tmdby::Setup.key = "your_api_key"
By default, every call to TMDB Api is set in insecure mode (HTTP). If you want to enable HTTPS :
Tmdby::Setup.secure = true
If you want, you can set a default language value :
Tmdby::Setup.default_language = "fr"
Example of use
- Get Movie by id :
Tmdby::Movies.get 550
- Find by IMDB id :
Tmdby::Find.get "tt0266543", 'imdb_id', language:'es'
- Discover Movies by criterias :
Tmdby::Discover.movie year: 1994, with_cast: 1269
You can take a look in the tests directory to view a lot of examples.
todo
Just call rake with your credentials :
% TMDB_API_KEY=<your_tmdb_api_key> TMDB_USERNAME=<your_tmdb_username> TMDB_PASSWORD=<your_tmdb_password> rake
Run options: --seed 60805
# Running:
.......................................................S...................................................................S.
Finished in 53.308930s, 2.3448 runs/s, 16.0573 assertions/s.
125 runs, 856 assertions, 0 failures, 0 errors, 2 skips
You have skipped tests. Run with --verbose for details.
- 2016-10-17 Add recommendation api , up-to-date with "Captain America" TMDB API update See blog post
- 2016-01-27 Add movie/id/release_dates api See blog post
- 2015-10-30 Up-to-date with "Jurassic World" TMDB API update
- callback parameter support
- images helpers
- Fork it ( https://github.com/a-legrand/tmdby/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request