Giter VIP home page Giter VIP logo

sofa's Introduction

Sofa

A simple Ruby library for the TVRage API (viewable here).

Shows

Sofa::TVRage::Show.by_name("Chuck")    # => #<Sofa::TVRage::Show:0x101360d38 @name="Chuck", @show_id="15614", ...>
OR
show = Sofa::TVRage::Show.new("15614") # => #<Sofa::TVRage::Show:0x1012ec3c0 @name="Chuck", @show_id="15614", ...>

Get the currently running shows
shows = Sofa::TVRage::Show.current     # => [#<Sofa::TVRage::Show:0x101256c0 @name="Chuck", @show_id="15614", ...>, #<Sofa::TVRage::Show:0x1012ec3c0 @name="Castle", @show_id="12345", ...>, ...]

Eager loading Season and Episode info

Sofa::TVRage::Show.by_name("Chuck", :greedy => true)
Sofa::TVRage::Show.new("15614", :greedy => true)

Attributes

show.show_id        # => "15614"
show.name           # => "Chuck"
show.show_link      # => "http://tvrage.com/Chuck"
show.started        # => "2007"
show.network        # => "NBC"
show.air_time       # => "20:00"
show.time_zone      # => "GMT-5 -DST"
show.run_time       # => "60"
show.origin_country # => "US"
show.air_day        # => "Monday"
show.ended          # => nil
show.classification # => "Scripted"
show.seasons        # => "3"
show.start_date     # => "Sep/24/2007"
show.status         # => "Returning Series"
show.genres         # => ["Action", "Comedy", "Drama"]
show.akas           # => "Chuck"

Seasons

show.season_list                # => [#<Sofa::TVRage::Season:0x1022d0f98 @no="1", @episodes=[...]>,
                                      #<Sofa::TVRage::Season:0x1022c88c0 @no="2", @episodes=[...]>,
                                      ...]
season = show.season_list.first # => #<Sofa::TVRage::Season:0x1022d0f98 @no="1", @episodes=[...]>

Attributes

season.episodes                 # => [#<Sofa::TVRage::Episode:0x1022d07a0 @title="Pilot", ...>,
                                      #<Sofa::TVRage::Episode:0x1022cf148 @title="Chuck Versus the Helicopter", ...>,
                                      ...]
season.no                       # => "1"

Episodes

show.episode_list                 # => [#<Sofa::TVRage::Episode:0x1022d07a0 @title="Pilot", ...>,
                                        #<Sofa::TVRage::Episode:0x1022cf148 @title="Chuck Versus the Helicopter", ...>,
                                        ...]
episode = show.episode_list.first # => #<Sofa::TVRage::Episode:0x1022d07a0 @title="Pilot", ...>

Attributes

episode.title         # => "Pilot"
episode.air_date      # => "2007-09-24"
episode.num_in_season # => "01"
episode.num           # => "1"
episode.prod_num      # => "101"
episode.link          # => "http://www.tvrage.com/Chuck/episodes/579282"

Contributing

  • Feel free to send feature/pull requests.

Copyright

Copyright (c) 2009 Henry Hsu. See LICENSE for details.

sofa's People

Contributors

hsume2 avatar jewilmeer avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.