Project

jawbone

0.06
No commit activity in last 3 years
No release in over 3 years
A Ruby wrapper for the Jawbone UP API.
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
>= 0

Runtime

~> 0.11.0
 Project Readme

Ruby wrapper for the Jawbone UP API.

Install with

gem install jawbone

Once you've set up your app and have a token for your user:

client = Jawbone::Client.new "your_token"

Then you can do things like:

> client.user
=> {
    "meta" => {
        "user_xid" => "bacseY7NGC0",
         "message" => "OK",
            "code" => 200,
            "time" => 1379626539
    },
    "data" => {
          "xid" => "jd7m17NGC0",
        "image" => "",
         "last" => "Brett",
        "first" => "Andy"
    }
}

There are three instance methods on client directly related to the user and nothing else: user, friends, and trends.

In addition, Jawbone makes the following object types available:

"move", "body_event", "workout", "sleep", "meal", "cardiac_event", "generic_event", "mood"

This gem takes each of those types and provides methods for:

  • getting all of the objects, e.g client.workouts
  • getting a single object, e.g. client.workout("xid") where the xid is the xid returned by client.workouts.
  • getting a graph for that object, e.g. client.workout_graph("xid")
  • getting a detailed report on that object, e.g. client.workout_intensity("xid")
  • creating a new object, e.g. client.create_workout(params)

Jawbone does not necessarily support all of these methods on all objects. For example, there's no endpoint to create a new "move" object. Calling these methods will return an error message.

Refreshing user tokens post heartbleed

  • get refreshed users token client.refresh_token("CLIENT_SECRET"), returns refreshed user token

See https://jawbone.com/up/developer/endpoints for the full documentation.

By default, an application only gets basic_read permission from Jawbone. You have to specify additional scopes when you send the user to Jawbone to grant your app permissions to read their account.

I've also got an omniauth strategy for Jawbone right here, special price for special friends of Rick.