work in progress
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
First you have to enter your credentials (API_KEY, ACCOUNT_ID, USERNAME and PASSWORD) in tests/credentials.rb
Then you can run the test suite :
% ruby tests/minitest_all.rb
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.
- 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