A simple Ruby gem to interface with the TVDB.org API, making it easy to search and fetch information about TV series, films, and people.
Installation
Add this line to your application's Gemfile:
gem 'tvdb_api'And then execute:
bundle installOr install it yourself as:
gem install tvdb_apiConfiguration
Set the following environment variables:
export TVDB_API_TOKEN=your_api_key
export TVDB_PIN=your_pinUsage
require 'tvdb_api'
api = TVDBApi.newSearch
Search across TV shows, films, and people:
response = api.search('The Dark Knight')Search by Type
Filter search results by type:
# Search for series only
response = api.search_by_type('The Simpsons', 'series')
# Search for movies only
response = api.search_by_type('Star Wars', 'movie')Get Movie Details
response = api.movie(12879)Get Series Details
response = api.series(75299)Get Person Details
response = api.person(256583)Development
Prerequisites
- Ruby >= 3.2
- Bundler
Setup
git clone https://github.com/swmcc/tvdb_api.git
cd tvdb_api
make installMake Targets
| Target | Description |
|---|---|
make install |
Install dependencies |
make console |
Start interactive Ruby console with gem loaded |
make test |
Run all tests |
make test.focus |
Run tests with focus tag |
make lint |
Run RuboCop linter |
make lint.fix |
Auto-fix RuboCop offenses |
make check |
Run all checks (lint + test) |
make build |
Build the gem |
make clean |
Remove built gems |
make help |
Show all available targets |
Running Tests
make test
# or run a specific test file
bundle exec rspec spec/tvdb_api_spec.rb
# or run a specific test by line number
bundle exec rspec spec/tvdb_api_spec.rb:27Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/swmcc/tvdb_api.
License
The gem is available as open-source under the terms of the MIT License.