Project

foot_stats

0.01
No commit activity in last 3 years
No release in over 3 years
FootStats API Client in Ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0

Runtime

 Project Readme

Build Status

FootStats

FootStats API Client in Ruby.

Installation

Add this line to your application's Gemfile:

gem 'foot_stats'

And then execute:

bundle

Or install it yourself as:

gem install foot_stats

Setup

FootStats::Setup.setup do |config|
  config.username      = "username"
  config.password      = "password"
  config.logger        = Rails.logger
  config.base_url      = "http://footstats.com"
  config.payload_store = Redis.new
end

Usage

# Championship
#
championships = FootStats::Championship.all

# Championship
#
championship = championships.first

# Championship Classification
#
championship.classification

# Championship Teams
#
championship.teams

# Matches
#
matches = championship.matches

# Match
match = matches.first

# Narrations
#
match.narrations

# Live Feed
match.live

# OR
live = FootStats::Live.find(match.source_id)

# Goals
live.goals

# Scores
live.home_score
live.visitor_score

# Teams
live.home_team
live.visitor_team

# Live Players
live.home_team.players
live.visitor_team.players

# Initial Players
live.home_team.initial_players
live.visitor_team.initial_players

# Getting the FootStats Response for all feeds.
#
live.response

match.response

championship.response

Simulating responses

With this gem you can simulate responses if you had some footstats responses stored in somewhere:

# Live Feed
FootStats::Live.find(25563, response: FootStats::Response.new({ body: '....' }))

# Narrations Feed
response = FootStats::Response.new(resource_key: FootStats::Narration.resource_key, body: '...')
FootStats::Narration.find(match: 25563, response: response)

Contributing

  1. Fork it
  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 new Pull Request