github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

alexistoulotte / roh_my_golf

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 1
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Switch Branches (1)
    • master ✓
  • Switch Tags (0)
  • Branch List
Sending Request…

Ruby API for OhMyGolf service. — Read more

  Cancel

  Cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

README 
alexistoulotte (author)
Mon Mar 01 11:24:59 -0800 2010
commit  5d0e50c4bb32a81c704f20eea5c2ff2b246d6a81
tree    80fd1e09e6e8d6f44031936e0656788bc5c7f710
parent  1cc220dce11e41545246f7eb32e6f782bfe39a69
roh_my_golf /
name age
history
message
file .gitignore Wed Oct 14 02:35:44 -0700 2009 added .DS_Store files to gitignore [alexistoulotte]
file MIT-LICENSE Fri Oct 09 03:36:43 -0700 2009 Initial commit [alexistoulotte]
file README.mdown Mon Mar 01 11:24:59 -0800 2010 README [alexistoulotte]
file Rakefile Fri Oct 09 03:36:43 -0700 2009 Initial commit [alexistoulotte]
file init.rb Fri Oct 09 04:05:39 -0700 2009 Starting API [alexistoulotte]
directory lib/ Thu Dec 31 02:04:41 -0800 2009 improved authentication exceptions [alexistoulotte]
directory spec/ Thu Dec 31 02:04:41 -0800 2009 improved authentication exceptions [alexistoulotte]
README.mdown

RohMyGolf

Description

Ruby API for OhMyGolf! service.

Usage

First: login

session = RohMyGolf::Session.new
session.login('email@example.com', 'password')

Retrieving rounds

# retrieving first round
round = session.rounds.first

# retrieving players array of this round
round.players

# here the name of the course
round.course

# retrieving the par of first hole (3, 4 or 5)
round.holes.first.par

# retrieving the handicap of third hole (1 to 18)
round.holes.third.handicap

Need some stats?

# retrieving stats of Alexis Toulotte on last round
stats = session.rounds.last.stats(:player => 'Alexis Toulotte')

# or from beginning with a player regexp...
stats = session.stats(:player => /alexis/i)

# or for a specific course
stats = session.stats(:course => /apremont/i, :after => 1.week.ago)

# or for a specific round
stats = session.rounds.last.stats(:player => /alexis/i)

# then you will have a lot of methods, examples:
stats.under_or_equal_to_par_count
stats.over_par_percentage
stats.under_double_bogey_count
stats.net
stats.strokes
stats.net_average
stats.best
stats.worst

Need to retrieve, rounds, holes, scores or stats easily?

# rounds in St. Andrews course
session.query.rounds(:course => /andrew/i)

# holes having a handicap lower than 5.
session.query.holes(:handicap_lower_than => 5).scores

# scores after 1 month ago
session.query.scores(:after => 1.month.ago).first.birdie?

# stats for par 3 or 4
session.query.stats(:par_lower_than => 5).under_or_equal_to_bogey_percentage

Need to export data?

# session, rounds, holes,... can be converted to yaml.
session.to_yaml
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server