Project

nba

0.0
No commit activity in last 3 years
No release in over 3 years
NBA.rb is a Ruby library for retrieving NBA League games, schedules, teams and players.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5

Runtime

< 0.10, ~> 0.8
~> 1.8
~> 1.6.1
~> 0.18.1
 Project Readme

NBA.rb

Gem Version Build Status

NBA.rb is a Ruby library for retrieving NBA League games, schedules, teams and players.

Insipred by @sferik's MLB.rb.

Installation

gem install nba

Usage Examples

You could use nba command-line tool directly in your terminal.

$ nba games --date=20140102
Final/OT  -   Cavaliers     87  :  81    Magic
  Final   -      Heat      114  : 123   Warriors
  Final   -     Bulls       94  :  82   Celtics
  Final   -    Thunder      93  :  95     Nets
  Final   -     Spurs      101  : 105    Knicks
  Final   -      Suns       91  :  99  Grizzlies
  Final   -      Jazz       96  :  87    Bucks
  Final   - Trail Blazers  134  : 104   Bobcats
  Final   -     Kings      104  : 113    76ers
$ nba teams --name 'Lakers'
Name: Los Angeles Lakers
Founded: 1947
Conference: Western Conference
Division: Pacific Division
Coach: Mike D'Antoni
Championships: 2010 NBA Finals, 2009 NBA Finals
               2002 NBA Finals, 2001 NBA Finals
               2000 NBA Finals, 1988 NBA Finals
           	   1987 NBA Finals, 1985 NBA Finals
           	   1982 NBA Finals, 1980 NBA Finals
           	   1972 NBA Finals, 1954 NBA Finals
           	   1953 NBA Finals, 1952 NBA Finals
           	   1950 NBA Finals, 1949 BAA Finals
           	   1948 NBL Finals

Or you could use it in irb, which is an Interactive Ruby Shell

$ irb
>> require 'nba'
>> NBA::Game.all '20140102'
#  =>  Final/OT  -   Cavaliers     87  :  81    Magic
#  =>    Final   -      Heat      114  : 123   Warriors
#  =>    Final   -     Bulls       94  :  82   Celtics
#  =>    Final   -    Thunder      93  :  95     Nets
#  =>    Final   -     Spurs      101  : 105    Knicks
#  =>    Final   -      Suns       91  :  99  Grizzlies
#  =>    Final   -      Jazz       96  :  87    Bucks
#  =>    Final   - Trail Blazers  134  : 104   Bobcats
#  =>    Final   -     Kings      104  : 113    76ers
>> NBA::Team.all.first.name                    # => "Atlanta Hawks"
>> NBA::Team.all.first.founded                 # => 1946
>> NBA::Team.all.first.players.first.name      # => "Al Horford"
>> NBA::Team.all.first.players.first.number    # => 15
>> NBA::Team.all.first.players.first.position  # => ["Forward-center"]

Supported Ruby Versions

This library aims to support and is tested against the following Ruby implementations:

  • Ruby 1.9.3
  • Ruby 2.0.0
  • Ruby 2.1.0
  • JRuby

Colophon

NBA was built with the following tools:

And, special thanks to @sfeirk!

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Copyright

Copyright (c) 2010-2014 Larry Lv. See LICENSE for details.