Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sports_database

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sports_database

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

SportsDatabase

A ruby client to help with interacting to http://www.sportsdatabase.com/api. Currently tested and working on Ruby 2.2.1.

JSONP is returned from the API and this gem will handle the calls made to the API as well as parsing the JSONP returned.

Installation

Add this line to your application's Gemfile:

gem 'sports_database'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sports_database

Usage

Example call:

require 'sports_database'

# By default if no params are passed api_key will be set to quest and sport to ncaabb
client = SportsDatabase::Client.new({ api_key: "guest", sport: "ncaabb" })

# the following will perform the same query
client.query("full name, school name, team @ season=2014 and team=PURD")
client.query("full name, school name, team", "season=2014 and team=PURD")

# Result class example
result = client.query("date,points,o:points@team=Bears and season=2011 and site")
result.success? # => true
result.fail? # => false
result.status_code # => 200
result.data # => returns the array of hashes
#      [{:group=>"team = Bears and season = 2011 and site = home",
#        :data_set=>[{:date=>20110911, :points=>30, :o_points=>12},
#                  {:date=>20110925, :points=>17, :o_points=>27},
#                  {:date=>20111002, :points=>34, :o_points=>29},
#                  {:date=>20111016, :points=>39, :o_points=>10},
#                  {:date=>20111113, :points=>37, :o_points=>13},
#                  {:date=>20111120, :points=>31, :o_points=>20},
#                  {:date=>20111204, :points=>3, :o_points=>10},
#                  {:date=>20111218, :points=>14, :o_points=>38}]},
#        {:group=>"team = Bears and season = 2011 and site = away",
#          :data_set=>[{:date=>20110918, :points=>13, :o_points=>30},
#                   {:date=>20111010, :points=>13, :o_points=>24},
#                   {:date=>20111023, :points=>24, :o_points=>18},
#                   {:date=>20111107, :points=>30, :o_points=>24},
#                   {:date=>20111127, :points=>20, :o_points=>25},
#                   {:date=>20111211, :points=>10, :o_points=>13},
#                   {:date=>20111225, :points=>21, :o_points=>35},
#                   {:date=>20120101, :points=>17, :o_points=>13}]}]

Contributing

  1. Fork it ( https://github.com/[my-github-username]/sdb_api_client/fork )
  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 a new Pull Request

FAQs

Package last updated on 20 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc