README.rdoc in simplificator-withings-0.3.4 vs README.rdoc in simplificator-withings-0.4.0

- old
+ new

@@ -1,9 +1,31 @@ = simplificator-withings This is a ruby implementation for the Withings API. Description of the API can be found here: http://www.withings.com/en/api +== Versions == + +Note that this release (0.4.0) breaks the API of previous releases: + +=== User.authenticate === + + User.authenticate() has been replaced by User.userlist + +There is no description available and no guarantee on the order that users are returned by the API (and yes, there can be many users for a single Account) +so it seems best to leave the decision to the users of the API. + +The old method is still there but please update your code. It will be removed in the next release. + +=== MeasurementGroup === + + MeasurementGroup#createt_at has been replaced by MeasurementGroup#taken_on + +Created at is usually the timestamp at which a record was created. But MeasurementGroup#created_at was the timestamp when you actually took the measurement. You can also take measurements (via the Web UI on withings.com) which are for a past date. The record is created today, but the measurement +was taken on 2 weeks ago. + +The old method is still there but please update your code. It will be removed in the next release. + == Installation gem install simplificator-withings == Authentication @@ -54,19 +76,20 @@ 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.authenticate('<YOUR EMAIL ADDRESS>', '<YOUR PASSWORD>') + user = User.userlist('<YOUR EMAIL ADDRESS>', '<YOUR PASSWORD>').first # or any other user which is returned 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 user.subscribe_notification('http://foo.bar.com', 'test subscription') @@ -77,9 +100,11 @@ user.measurement_groups(:per_page => 10, :page => 1, :end_at => Time.now) user.measurement_groups(:category => MeasurementGroup::CATEGORY_TARGET) user.measurement_groups(:last_updated_at => Time.at(12345)) user.measurement_groups(:start_at => Time.at(12345), :end_at => Time.at(67890)) user.measurement_groups(:measurement_type => MeasurementGroup::TYPE_FAT) + user.measurement_groups(:device => Withings::SCALE) + == Note on keys in hashes Keys to constructors (User, MeasurementGroup and NotificationDescription) and methods (User.measurement_groups) can be either String or Symbol