# score-scraper This gem is used to retrieve NBA or MLB scores. Please note I do not own any of the information provided by this gem, all nba scores are retrieved from a publicly available json file on nba.com and all mlb scores are are retreived from a publicly available json file on mlb.com. It is entirely possible that these files will change and this gem will break, if that happens I will do my best to keep up with any changes. ## Installation Add this line to your application's Gemfile: ```ruby gem 'score-scraper' ``` And then execute: $ bundle Or install it yourself as: $ gem install score-scraper ## Usage ### Get scores of games for nba teams ```ruby require 'score_scraper' scraper = ScoreScraper::Scrapers::Nba.new(Time.now.strftime("%Y-%m-%d"), # Date you want to search ['chi','det']) # Teams you want to find, pass nothing in for all teams # team_games will return Game objects for the teams defined in the initialize games = scraper.team_games # => [#, @away_team=#, @game_state="1Q">, #, @away_team=#, @game_state="6:00 pm ET">] ``` ## Development Contributions are welcome, feel free to expand on current functionality or add new leagues. ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/DNeier/score-scraper. ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).