fitbit-to-graphite 0.1.1 → 0.1.2
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/Gemfile.lock +7 -1
- data/bin/fitbit-to-graphite.rb +4 -2
- data/fitbit-to-graphite.gemspec +2 -1
- metadata +17 -1
data/Gemfile.lock
CHANGED
@@ -1,17 +1,23 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fitbit-to-graphite (0.1.
|
4
|
+
fitbit-to-graphite (0.1.1)
|
5
5
|
choice
|
6
6
|
fitgem
|
7
|
+
tzinfo
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
10
11
|
specs:
|
12
|
+
atomic (1.1.14)
|
11
13
|
choice (0.1.6)
|
12
14
|
fitgem (0.8.0)
|
13
15
|
oauth
|
14
16
|
oauth (0.4.7)
|
17
|
+
thread_safe (0.1.3)
|
18
|
+
atomic
|
19
|
+
tzinfo (1.1.0)
|
20
|
+
thread_safe (~> 0.1)
|
15
21
|
|
16
22
|
PLATFORMS
|
17
23
|
ruby
|
data/bin/fitbit-to-graphite.rb
CHANGED
@@ -9,8 +9,9 @@ require 'yaml'
|
|
9
9
|
|
10
10
|
require 'choice'
|
11
11
|
require 'fitgem'
|
12
|
+
require 'tzinfo'
|
12
13
|
|
13
|
-
PROGRAM_VERSION = "0.1.
|
14
|
+
PROGRAM_VERSION = "0.1.2"
|
14
15
|
SLEEP_STATE_TYPES = ['deep', 'light', 'awake']
|
15
16
|
# this is just to be compatible with jawbone data
|
16
17
|
JAWBONE_SLEEP_STATES = { 'awake' => 1, 'light' => 2, 'deep' => 3 }
|
@@ -123,7 +124,8 @@ def extract_data(client, &block)
|
|
123
124
|
return
|
124
125
|
end
|
125
126
|
user_info = client.user_info
|
126
|
-
|
127
|
+
user_timezone_name = user_info['user']['timezone']
|
128
|
+
user_timezone = offset = TZInfo::Timezone.get(user_timezone_name).current_period.utc_total_offset / (60*60)
|
127
129
|
today = Date.today
|
128
130
|
all_sleep_data = client.sleep_on_date(today)['sleep']
|
129
131
|
if all_sleep_data.nil?
|
data/fitbit-to-graphite.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |gem|
|
2
2
|
gem.name = 'fitbit-to-graphite'
|
3
|
-
gem.version = '0.1.
|
3
|
+
gem.version = '0.1.2'
|
4
4
|
gem.authors = ["Daniel Schauenberg"]
|
5
5
|
gem.email = 'd@unwiredcouch.com'
|
6
6
|
gem.homepage = 'https://github.com/mrtazz/fitbit-to-graphite'
|
@@ -14,4 +14,5 @@ Gem::Specification.new do |gem|
|
|
14
14
|
|
15
15
|
gem.add_runtime_dependency "fitgem"
|
16
16
|
gem.add_runtime_dependency "choice"
|
17
|
+
gem.add_runtime_dependency "tzinfo"
|
17
18
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fitbit-to-graphite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -43,6 +43,22 @@ dependencies:
|
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: tzinfo
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
46
62
|
description: script to import fitbit sleep data into graphite
|
47
63
|
email: d@unwiredcouch.com
|
48
64
|
executables:
|