Project

tv_maze

0.0
No commit activity in last 3 years
No release in over 3 years
A Ruby wrapper for the TvMaze api: http://www.tvmaze.com/api API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 10.0
~> 3.3.0
~> 2.9.3
~> 1.21.0

Runtime

 Project Readme

Information

tv_maze Code Climate Gem Version

A Ruby wrapper for the Tv Maze. Provides a simple, easy to use interface for the TvMaze API.

Getting started

Add this line to your application's Gemfile:

gem 'tv_maze'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install tv_maze

Usage

TvMaze::Show.find(show_id)
TvMaze::Show.cast(show_id)
TvMaze::Show.alternative_names(show_id)
TvMaze::Show.seasons(show_id)
TvMaze::Show.find_by_imdb_id(imdb_id)
TvMaze::Show.find_by_tvrage_id(tvrage_id)
TvMaze::Show.find_by_tvdb_id(tvdb_id)
TvMaze::Show.all(page)
TvMaze::Show.search(query)

Examples

Show detail

> show = TvMaze::Show.find(1)
=> #<TvMaze::Show id=1, name="Under the Dome", type="Scripted", ...
> show.name 
=> "Under the Dome"
> show.type 
=> "Scripted"
> show.network
=> #<TvMaze::Network id=2, name="CBS", country=#<TvMaze::Country name="United States", code="US", timezone="America/New_York">>
> show.external_ids
=> #<TvMaze::ExternalIds tvrage=25988, thetvdb=264492, imdb="tt1553656">
> show.airing_schedule
=> #<TvMaze::AiringSchedule time="22:00", days=["Thursday"]>

Cast details

> show = TvMaze::Show.cast(1)
=>  [#<TvMaze::Cast person=#<TvMaze::Person id=9, name="Dean Norris", image=#<TvMaze::Image ...

Embeding

# fetc cast, episoes and next episodes data as well
> TvMaze::Show.find(17153, embed: ['episodes', 'cast', 'nextepisode'])

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also 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, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/naveed-ahmad/tv_maze. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.