projects
/
kraftakt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
87ea973
)
Also subscribe to the "sleep" Fitbit collection.
author
Florian Forster
<ff@octo.it>
Thu, 25 Jan 2018 19:46:42 +0000
(20:46 +0100)
committer
Florian Forster
<ff@octo.it>
Thu, 25 Jan 2018 19:46:42 +0000
(20:46 +0100)
fitbit/fitbit.go
patch
|
blob
|
history
gfitsync.go
patch
|
blob
|
history
diff --git
a/fitbit/fitbit.go
b/fitbit/fitbit.go
index
04c50cd
..
4555e22
100644
(file)
--- a/
fitbit/fitbit.go
+++ b/
fitbit/fitbit.go
@@
-22,7
+22,12
@@
var oauth2Config = &oauth2.Config{
ClientSecret: "@FITBIT_CLIENT_SECRET@",
Endpoint: oauth2fitbit.Endpoint,
RedirectURL: "https://kraftakt.octo.it/fitbit/grant",
ClientSecret: "@FITBIT_CLIENT_SECRET@",
Endpoint: oauth2fitbit.Endpoint,
RedirectURL: "https://kraftakt.octo.it/fitbit/grant",
- Scopes: []string{"activity", "heartrate", "profile"},
+ Scopes: []string{
+ "activity",
+ "heartrate",
+ "profile",
+ "sleep",
+ },
}
const csrfToken = "@CSRFTOKEN@"
}
const csrfToken = "@CSRFTOKEN@"
diff --git
a/gfitsync.go
b/gfitsync.go
index
61e9107
..
7f28bb0
100644
(file)
--- a/
gfitsync.go
+++ b/
gfitsync.go
@@
-130,6
+130,10
@@
func fitbitGrantHandler(ctx context.Context, w http.ResponseWriter, r *http.Requ
return fmt.Errorf("c.Subscribe() = %v", err)
}
return fmt.Errorf("c.Subscribe() = %v", err)
}
+ if err := c.Subscribe(ctx, "sleep"); err != nil {
+ return fmt.Errorf("c.Subscribe() = %v", err)
+ }
+
redirectURL := r.URL
redirectURL.Path = "/"
redirectURL.RawQuery = ""
redirectURL := r.URL
redirectURL.Path = "/"
redirectURL.RawQuery = ""