Git Product home page Git Product logo

fantasydata's Introduction

Fantasydata

Gem VersionBuild StatusCode ClimateTest Coverage

A Ruby interface to the Fantasy Data API. The Fantasy Data API delivery historical and up to the second NFL, NBA and MLB data. This gem currently only supports the NFL Data but could be expanded to include the others as well. Details about the API can be found here: https://developer.fantasydata.com/documentation. For a Implementation guide check out this page: http://fantasydata.com/resources/implementation-guide.aspx.

Supported Rubies

The following Ruby versions are tested in Travis CI:

  • 2.2.2
  • 2.2.0
  • 2.1.5
  • 2.0.0
  • 1.9.3
  • jruby-19mode
  • rbx-18mode
  • rbx-19mode

Gem Dependencies

Installing this gem also installs the following gems:

  • faraday HTTP client lib that provides a common interface over many adapters (such as Net::HTTP) and embraces the concept of Rack middleware when processing the request/response cycle.
  • multi_json A common interface to multiple JSON libraries, including Oj, Yajl, the JSON gem (with C-extensions), the pure-Ruby JSON gem, NSJSONSerialization, gson.rb, JrJackson, and OkJson.

Installation

Add this line to your application's Gemfile:

gem 'fantasydata'

And then execute:

$ bundle

Or install it yourself as:

$ gem install fantasydata

Usage

Go to Fantasy Data and sign up for an account to get an API Key.

Then copy and paste in your API keys:

Fantasydata.configure do |config|
  config.api_key =       'YOUR_API_KEY'
end

If you are using Fantasydata with a Rails application then a good location for the key would be to create an initializer, for example you could place the above code in /config/initializers/fantasydata.rb.

You can now use Fantasydata like this:

Fantasydata.current_week

Contributing

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

Inspiration

This gem relied heavily on the Echowrap gem to follow best practices around the structure of the gem, tests and documentation.

fantasydata's People

Contributors

drosty avatar

Stargazers

George Wambold avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

johnkoht

fantasydata's Issues

Document all calls

Box Scores has this started - should do this for all API calls for better documentation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.