While working on an NHL god's website, we needed easy access to player stats and team schedules. ESPN has an API, but its pretty terrible unless your a super-duper-fabulous-partner. Thus, Zamboni was born. A simple screen scraping gem for NHL player & team info.
Btw, that god was this guy:
Add this line to your application's Gemfile:
gem 'Zamboni'
And then execute:
$ bundle
Or install it yourself as:
$ gem install Zamboni
Because our project is based on a single player, we simply sub-classed Zamboni::Player
class Pavel < Zamboni::Player
end
set the id from ESPN
#http://espn.go.com/nhl/player/_/id/1223/pavel-datsyuk
#------find player id here----------^^^^--------------
class Pavel < Zamboni::Player
def initialize
@id = 1223
end
end
and then call instance methods like .season_stats or info.
pavel = new Pavel
pavel.info['name'] #Pavel Datsyuk
pavel.info['age'] #34
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request