Module: StatsRequest
- Included in:
- NbaRb::Game::BaseClass, NbaRb::Game::PlayByPlay, NbaRb::Player::BaseClass, NbaRb::Player::Career, NbaRb::Player::Dashboard, NbaRb::Player::GameLogs, NbaRb::Player::List, NbaRb::Player::Summary, NbaRb::Player::VsPlayer, NbaRb::Team::BaseClass
- Defined in:
- lib/helpers/stats_request.rb
Instance Method Summary collapse
Instance Method Details
#stats_request(endpoint, params) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/helpers/stats_request.rb', line 2 def stats_request(endpoint, params) res = HTTParty.get(NbaRb::BASE_URL + endpoint, query: params, headers: { 'user-agent' => 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36', 'Dnt' => '1', 'Accept-Encoding' => 'gzip, deflate, sdch', 'Accept-Language' => 'en', 'origin' => 'http://stats.nba.com' } ) res.parsed_response end |