simplificator-withings 0.6.5 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +8 -0
- data/lib/withings/connection.rb +1 -15
- data/lib/withings/user.rb +9 -0
- data/simplificator-withings.gemspec +1 -1
- metadata +77 -83
data/README.rdoc
CHANGED
@@ -3,6 +3,11 @@
|
|
3
3
|
This is a ruby implementation for the Withings API. Description of the API can be found here: http://www.withings.com/en/api
|
4
4
|
|
5
5
|
== Versions ==
|
6
|
+
|
7
|
+
=== 0.6.6 ===
|
8
|
+
|
9
|
+
Added list_notifications method to user.
|
10
|
+
|
6
11
|
=== 0.6.3 ===
|
7
12
|
|
8
13
|
Fixed escaping for parameters.
|
@@ -108,6 +113,9 @@ Specify what devices you are interested
|
|
108
113
|
user.describe_notification('http://foo.bar.com')
|
109
114
|
user.revoke_notification('http://foo.bar.com')
|
110
115
|
|
116
|
+
List notifications is now possible
|
117
|
+
user.list_notifications
|
118
|
+
|
111
119
|
And finally you can get measurements, after all this is what it's for
|
112
120
|
user.measurement_groups(:per_page => 10, :page => 1, :end_at => Time.now)
|
113
121
|
user.measurement_groups(:category => MeasurementGroup::CATEGORY_TARGET)
|
data/lib/withings/connection.rb
CHANGED
@@ -87,18 +87,4 @@ class Withings::Connection
|
|
87
87
|
raise Withings::ApiError.new(response['status'], path, params)
|
88
88
|
end
|
89
89
|
end
|
90
|
-
end
|
91
|
-
|
92
|
-
|
93
|
-
#http://wbsapi.withings.net/measure?action=getmeas&
|
94
|
-
#oauth_consumer_key=7e563166232c6821742b4c277350494a455f392b353e5d49712a34762a&
|
95
|
-
#oauth_nonce=f22d74f2209ddf0c6558a47c02841fb1&
|
96
|
-
#oauth_signature=yAF9SgZa09SPl3H1Y5aAoXgyauc=&
|
97
|
-
#oauth_token=c68567f1760552958d713e92088db9f5c5189754dfe4e92068971f4e25d64&
|
98
|
-
#oauth_version=1.0&
|
99
|
-
#userid=1229
|
100
|
-
|
101
|
-
#User: Tobias Miesel
|
102
|
-
#user_id: 666088
|
103
|
-
#oauth_token: 284948c9b4b9cce1cc76bbb77283431d9bbb9b46beddfccb79241cc12
|
104
|
-
#oauth_token_secret: 02f01f0e60182684676644ddbef2638e8e4de909f776340e1b5dd612dcbf
|
90
|
+
end
|
data/lib/withings/user.rb
CHANGED
@@ -35,6 +35,15 @@ class Withings::User
|
|
35
35
|
Withings::NotificationDescription.new(response.merge(:callbackurl => callback_url))
|
36
36
|
end
|
37
37
|
|
38
|
+
# List the notifications for a device (defaults to SCALE), pass nil to list all devices.
|
39
|
+
def list_notifications(device = SCALE)
|
40
|
+
options = (device.nil? ? {} : {:appli => device})
|
41
|
+
response = connection.get_request('/notify', options.merge({:action => :list}))
|
42
|
+
response['profiles'].map do |item|
|
43
|
+
Withings::NotificationDescription.new(item)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
38
47
|
|
39
48
|
# list measurement groups
|
40
49
|
# The limit and offset parameters are converted to will_paginate style parameters (:per_page, :page)
|
metadata
CHANGED
@@ -1,88 +1,89 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplificator-withings
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.6.6
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 6
|
9
|
-
- 5
|
10
|
-
version: 0.6.5
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- pascalbetz
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-04-18 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: shoulda
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
version: "0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
32
22
|
type: :development
|
33
|
-
version_requirements: *id001
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: mocha
|
36
23
|
prerelease: false
|
37
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: mocha
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
38
33
|
none: false
|
39
|
-
requirements:
|
40
|
-
- -
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
|
43
|
-
segments:
|
44
|
-
- 0
|
45
|
-
version: "0"
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
46
38
|
type: :development
|
47
|
-
version_requirements: *id002
|
48
|
-
- !ruby/object:Gem::Dependency
|
49
|
-
name: httparty
|
50
39
|
prerelease: false
|
51
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: httparty
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
52
49
|
none: false
|
53
|
-
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
|
57
|
-
segments:
|
58
|
-
- 0
|
59
|
-
version: "0"
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
60
54
|
type: :runtime
|
61
|
-
version_requirements: *id003
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: ruby-hmac
|
64
55
|
prerelease: false
|
65
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: ruby-hmac
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
66
65
|
none: false
|
67
|
-
requirements:
|
68
|
-
- -
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
|
71
|
-
segments:
|
72
|
-
- 0
|
73
|
-
version: "0"
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
74
70
|
type: :runtime
|
75
|
-
|
76
|
-
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
description: A withings API implementation in ruby. Created for the evita project
|
79
|
+
at evita.ch
|
77
80
|
email: info@simplificator.com
|
78
81
|
executables: []
|
79
|
-
|
80
82
|
extensions: []
|
81
|
-
|
82
|
-
extra_rdoc_files:
|
83
|
+
extra_rdoc_files:
|
83
84
|
- LICENSE
|
84
85
|
- README.rdoc
|
85
|
-
files:
|
86
|
+
files:
|
86
87
|
- .document
|
87
88
|
- LICENSE
|
88
89
|
- README.rdoc
|
@@ -99,37 +100,30 @@ files:
|
|
99
100
|
- test/users_test.rb
|
100
101
|
homepage: http://github.com/simplificator/simplificator-withings
|
101
102
|
licenses: []
|
102
|
-
|
103
103
|
post_install_message:
|
104
|
-
rdoc_options:
|
104
|
+
rdoc_options:
|
105
105
|
- --charset=UTF-8
|
106
|
-
require_paths:
|
106
|
+
require_paths:
|
107
107
|
- lib
|
108
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
109
109
|
none: false
|
110
|
-
requirements:
|
111
|
-
- -
|
112
|
-
- !ruby/object:Gem::Version
|
113
|
-
|
114
|
-
|
115
|
-
- 0
|
116
|
-
version: "0"
|
117
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ! '>='
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
115
|
none: false
|
119
|
-
requirements:
|
120
|
-
- -
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
|
123
|
-
segments:
|
124
|
-
- 0
|
125
|
-
version: "0"
|
116
|
+
requirements:
|
117
|
+
- - ! '>='
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
126
120
|
requirements: []
|
127
|
-
|
128
121
|
rubyforge_project:
|
129
|
-
rubygems_version: 1.8.
|
122
|
+
rubygems_version: 1.8.21
|
130
123
|
signing_key:
|
131
124
|
specification_version: 3
|
132
125
|
summary: API implementation for withings.com
|
133
|
-
test_files:
|
126
|
+
test_files:
|
134
127
|
- test/helper.rb
|
135
128
|
- test/users_test.rb
|
129
|
+
has_rdoc:
|