misfit_gem 0.1.0 → 0.1.1
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.
- checksums.yaml +8 -8
- data/README.md +101 -2
- data/lib/misfit_gem/client.rb +0 -1
- data/lib/misfit_gem/sessions.rb +1 -1
- data/lib/misfit_gem/sleeps.rb +1 -1
- data/lib/misfit_gem/version.rb +1 -1
- data/misfit_gem.gemspec +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjEzYzczODk4M2NhMjdhYTIxZTdhZWFlYjU4NmJjMjRmMDJlMDU0YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YmNmNmM1YTdhNmM2OWQxZTcyMzQwNGNiZTFlNDk0YzRmNGI1NDE2Ng==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjlmMDQ2NzBhZmUwNGMzMDAyOWViOTRhNmM5MzFiNWM5ZWQ2MGFmYzgxY2Vj
|
10
|
+
ZjFmNmIwZGZkY2VmNmY0ODFlODI3NjMzM2NlMDUyZDczZmRiYTFkYWFkNmM5
|
11
|
+
MWVlNWFhNDUyODIwNDliN2RlNmIyNzg1OGI1NzQ5YTRmMGJlMjM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Mzg0NTdmMTk3ZDE5OWI1NGNkYzhmMzhiYzdlNmY4NGRmMmE2ZDFjNDNjMzcz
|
14
|
+
Yjk2MDI1M2Q1NTViMTdkMGY0Zjk5OTk1YjE5ZjhmODJkZjNlODc5YmEyNDA2
|
15
|
+
MTM3OWM2ODZlMGJhYWIxYTc1NjMwMWUzNTBjNzM1Zjk1M2ZhMjc=
|
data/README.md
CHANGED
@@ -1,4 +1,103 @@
|
|
1
|
-
|
1
|
+
MisfitGem
|
2
2
|
==========
|
3
3
|
|
4
|
-
|
4
|
+
Provides access to the Misfit Shine API (http://build.misfit.com) through oAuth.
|
5
|
+
|
6
|
+
As the Misfit Shine API is currently in BETA and under development, pull requests are appreciated if API support starts to show gaps.
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Install misfit_gem
|
11
|
+
|
12
|
+
```bash
|
13
|
+
$ gem install misfit_gem
|
14
|
+
```
|
15
|
+
|
16
|
+
or add it to your Gemfile
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
gem 'misfit_gem'
|
20
|
+
```
|
21
|
+
|
22
|
+
## Authentication
|
23
|
+
|
24
|
+
Omniauth is the best way to connect your users to the Misfit API. Use [omniauth-shine](https://github.com/socialworkout/omniauth-shine) to integrate Misfit accounts into your web application. You will need the OAuth `access_token` as a minimum.
|
25
|
+
|
26
|
+
## Configuration
|
27
|
+
|
28
|
+
In order to use MisfitGem you'll first need to configure a client.
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
@client ||= MisfitGem::Client.new(
|
32
|
+
consumer_key: ENV["MISFIT_API_KEY"],
|
33
|
+
consumer_secret: ENV["MISFIT_API_SECRET"],
|
34
|
+
token: oauth_access_token,
|
35
|
+
secret: oauth_secret
|
36
|
+
)
|
37
|
+
```
|
38
|
+
|
39
|
+
## Usage
|
40
|
+
|
41
|
+
See the [Misfit Resource Reference](https://build.misfit.com/docs/references#APIReferences-ResourceServerAPIs) for more details on request and response parameters.
|
42
|
+
|
43
|
+
### Profile
|
44
|
+
|
45
|
+
Gets the current user's profile information
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
@client.get_profile
|
49
|
+
```
|
50
|
+
|
51
|
+
### Device
|
52
|
+
|
53
|
+
Get the current user's device information (only returns information about one - current - device)
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
@client.get_device
|
57
|
+
```
|
58
|
+
|
59
|
+
### Goal
|
60
|
+
|
61
|
+
Get the user's goals within a period.
|
62
|
+
|
63
|
+
**Required:** Start Date and End Date (Date object or "YYYY-MM-DD" string).
|
64
|
+
|
65
|
+
```ruby
|
66
|
+
@client.get_goals(start_date: Date.today - 1.week, end_date: Date.today)
|
67
|
+
```
|
68
|
+
|
69
|
+
### Summary
|
70
|
+
|
71
|
+
Get a summary of the user's activity within a period.
|
72
|
+
|
73
|
+
**Required:** Start Date and End Date (Date object or "YYYY-MM-DD" string).
|
74
|
+
|
75
|
+
*Optional: Detail (true/false). Defaults to false.*
|
76
|
+
|
77
|
+
```ruby
|
78
|
+
@client.get_summary(start_date: Date.today - 1.week, end_date: Date.today, detail: true)
|
79
|
+
```
|
80
|
+
|
81
|
+
### Session
|
82
|
+
|
83
|
+
Get the user's sessions within a period.
|
84
|
+
|
85
|
+
**Required:** Start Date and End Date (Date object or "YYYY-MM-DD" string).
|
86
|
+
|
87
|
+
```ruby
|
88
|
+
@client.get_sessions(start_date: Date.today - 1.week, end_date: Date.today)
|
89
|
+
```
|
90
|
+
|
91
|
+
### Sleep
|
92
|
+
|
93
|
+
Get the user's sleeps within a period.
|
94
|
+
|
95
|
+
**Required:** Start Date and End Date (Date object or "YYYY-MM-DD" string).
|
96
|
+
|
97
|
+
```ruby
|
98
|
+
@client.get_sleeps(start_date: Date.today - 1.week, end_date: Date.today)
|
99
|
+
```
|
100
|
+
|
101
|
+
## Disclaimer
|
102
|
+
|
103
|
+
I am not employed by Misfit. This gem was created to help ruby developers build applications on top of misfit.com's data.
|
data/lib/misfit_gem/client.rb
CHANGED
data/lib/misfit_gem/sessions.rb
CHANGED
@@ -13,7 +13,7 @@ module MisfitGem
|
|
13
13
|
|
14
14
|
check_date_range(start_date_string, end_date_string)
|
15
15
|
|
16
|
-
parameters = "start_date=#{start_date_string}&end_date=#{end_date_string}
|
16
|
+
parameters = "start_date=#{start_date_string}&end_date=#{end_date_string}"
|
17
17
|
|
18
18
|
get("/user/me/activity/sessions?#{parameters}")
|
19
19
|
|
data/lib/misfit_gem/sleeps.rb
CHANGED
@@ -13,7 +13,7 @@ module MisfitGem
|
|
13
13
|
|
14
14
|
check_date_range(start_date_string, end_date_string)
|
15
15
|
|
16
|
-
parameters = "start_date=#{start_date_string}&end_date=#{end_date_string}
|
16
|
+
parameters = "start_date=#{start_date_string}&end_date=#{end_date_string}"
|
17
17
|
|
18
18
|
get("/user/me/activity/sleeps?#{parameters}")
|
19
19
|
|
data/lib/misfit_gem/version.rb
CHANGED
data/misfit_gem.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: misfit_gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jay Whiting
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oauth
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
|
-
rubyforge_project:
|
104
|
+
rubyforge_project: misfit_gem
|
105
105
|
rubygems_version: 2.1.11
|
106
106
|
signing_key:
|
107
107
|
specification_version: 4
|