Permalink
Browse files

added usage instruction to readme file.

  • Loading branch information...
kennyma committed Oct 11, 2011
1 parent b6fcad5 commit f165e5c60706b6f1910d83de6c85e9c363e7028c
Showing with 38 additions and 1 deletion.
  1. +38 −1 README.rdoc
View
@@ -1,6 +1,43 @@
= health_graph
-Ruby gem to work with RunKeeper Health Graph API.
+Ruby gem to work with RunKeeper Health Graph API. More information about RunKeeper Health Graph API http://developer.runkeeper.com/healthgraph.
+
+== Usage
+
+=== Authentication
+
+HealthGraph.configure do |config|
+ config.client_id = [YOUR HEALTH GRAPH CLIENT ID]
+ config.client_secret = [YOUR HEALTH GRAPH CLIENT SECRET]
+ config.authorization_redirect_url = [PAGE TO REDIRECT THE USER TO AFTER AUTH]
+end
+
+auth_url = HealthGraph.authorize_url
+
+access_token = HealthGraph.access_token(auth_code)
+
+For more information on authentication & authorization, see http://developer.runkeeper.com/healthgraph/registration-authorization
+
+=== Accessing Health Graph API
+
+user = HealthGraph::User.new(access_token)
+profile = user.profile
+fitness_activities = user.fitness_activities.items
+sleep = user.sleep.items
+weight = user.weight.items
+
+=== Other Configuration options
+
+HealthGraph.configure do |config|
+ config.client_id = [YOUR HEALTH GRAPH CLIENT ID. REQUIRED.]
+ config.client_secret = [YOUR HEALTH GRAPH CLIENT SECRET. REQUIRED.]
+ config.authorization_redirect_url = [PAGE TO REDIRECT THE USER TO AFTER AUTH. REQUIRED.]
+ config.authorization_url = [URL TO AUTHORIZE USER. DEFAULT IS http://runkeeper.com/apps/authorize]
+ config.access_token_url = [URL TO GET USER ACCESS TOKEN. DEFAULT IS http://runkeeper.com/apps/token]
+ config.endpoint = [API ENDPOINT. DEFAULT IS http://api.runkeeper.com]
+ config.adapter = [FARADAY ADAPTER. DEFAULT IS net_http]
+ config.faraday_options = [ADDITIONAL FARADAY OPTIONS. DEFAULT IS EMPTY.]
+end
== Contributing to health_graph

0 comments on commit f165e5c

Please sign in to comment.