README.rdoc in simplificator-withings-0.4.5 vs README.rdoc in simplificator-withings-0.6.0

- old
+ new

@@ -2,11 +2,15 @@ This is a ruby implementation for the Withings API. Description of the API can be found here: http://www.withings.com/en/api == Versions == +=== 0.6.0 === +OAuth implemented. This version is not compatible to previous releases. +Authentication via userid/publickey is not supported anymore. + === 0.4.5 === E-Mail Address is downcased before hashing it (authentication) === 0.4.4 === Various fixes for the support of Blood Pressure Monitor @@ -33,21 +37,16 @@ The old method is still there but please update your code. It will be removed in the next release. == Installation gem install simplificator-withings +gem install ruby-hmac == Authentication -The WBS API provides a way to login by user_id and public_key. You can either ask your users to enter the user_id/public_key manually -(they can be found in the sharing overlay on my.withings.com) or ask them for email/password once and then use those credentials -to authenticate through the API (User.authenticate(email, password)). The User instance returned will have the -user_id and public_key attributes populated and you can store them for further use. +The WBS API now uses OAuth. See the API documentation for details. -As soon as you have user_id/public_key available you can either use User.info or User.new to create a User instance. While User.info -will make an API call to populate the attributes, User.new just requires user_id/public_key. - == TODO * Integration Test? But i don't want to share my credentials... Perhaps with a test account on withings? Solution from Withings support: Hi, @@ -83,24 +82,14 @@ require 'withings' All classes are name-spaced, if your other code allows you can include Withings include Withings -A user can be authenticated with email address and password - user = User.userlist('<YOUR EMAIL ADDRESS>', '<YOUR PASSWORD>').first # or any other user which is returned +A user can be authenticated using user id and oauth token/secret + user = User.authenticate('<YOUR USER ID>', '<YOUR OAUTH TOKEN>', '<YOUR OAUTH TOKEN SECRET>') -Or you can fetch details if you have the user id and public key - user = User.info('<YOUR USER ID>', '<YOUR PUBLIC KEY>') -If you already have user id and public key and you do not need further information on the user - user = User.new(:user_id => '<YOUR USER ID>', :public_key => '<YOUR PUBLIC_KEY>') - -enable/disable sharing, disabling it will reset the public key - user.share() # share all - user.share(Withings::SCALE, Withings::BLOOD_PRESSURE_MONITOR) - user.share(0) - You can handle subscriptions through the API (all devices currently known => Scale + Blood Pressure Monitor) user.subscribe_notification('http://foo.bar.com', 'test subscription') Specify what devices you are interested user.subscribe_notification('http://foo.bar.com', 'test subscription', Withings::SCALE, Withings::BLOOD_PRESSURE_MONITOR) @@ -145,6 +134,6 @@ Thanks for these Gems. == Copyright -Copyright (c) 2010 simplificator. See LICENSE for details. +Copyright (c) 2012 simplificator. See LICENSE for details.