First, Register the application at https://runkeeper.com/partner/applications. Then you can get the Client ID and Client Secret keys.
Next, create a token for OAuth 2.0.
- Execute
runkeeper/runkeeper_auth.rb- Acquire the access token interactively.
Save the acquired token as runkeeper/data/token.yml in the following format.
access_token: your access tokenCreate a runkeeper log csv file with the following command.
$> ruby runkeeper/runkeeper.rbFirst, register the application with dev.fitbit.com. Then you can get the key of the API.
Next, open "OAuth 2.0 tutorial page" at https://dev.fitbit.com/apps/new (MANAGE MY APPS tab) and issue a token of OAuth 2.
- 1: Authorize
- Select "Authorization Code Flow".
- "Expires In (ms)" is set to 31536000. This is set valid for 1 year.
- Other items can be default values.
- Access the created URL and obtain "code".
- 1A Get Code
- When you input "code" obtained on the screen, you can get the curl command and execute it.
- Modify the created curl command and add
-d "expires_in=31536000". - Include this setting and set the expiration date of the token to 1 year.
- Modify the created curl command and add
- You can get "Access token" and "Refresh token" by executing the curl command.
- When you input "code" obtained on the screen, you can get the curl command and execute it.
- 2: Parse response
- When copying and pasting the json response obtained with "1A Get Code", you can get a token.
Save the acquired token as fitbit/data/token.yml in the following format.
client_id: your client id
client_secret: your client secret
access_token: your oauth2.0 access token
refresh_token: your oauth2.0 refresh tokenCreate a fitbit log csv file with the following command.
$> ruby fitbit/fitbit.rbFirst, register the application with https://developer.health.nokia.com/partner/dashboard. Then you can get the key of the API.
Next, open "Nokia Health API developer documentation" at https://developer.health.nokia.com/api and issue a token of OAuth 2.
- Step 1 : get a oAuth "request token"
- Input your "Consumer key", "Consumer sercret", "Callback URL".
- Click "Generate Request Token creation URL".
- Open the generated URL.
- Step 2 : End-user authorization
- Input two keys and click the "Generate link to present to the user".
- Open the generated URL.
- Step 3 : Generating access token
- Input your user id and click the "Generate Access Token creation URL".
- Open the generated URL.
Save the obtained four keys, "Consumer key", "Consumer secret", "Access token", "Access token secret", "User ID" in withings/data/token.yml.
key: your key
secret: your secret
access_token: your oauth1.0 access token
access_token_secret: your oauth1.0 access token secret
user_id: your user idCreate a withings log csv file with the following command.
$> ruby withings/withings.rbRegister the API account with https://www.last.fm/api/account/create. Then you can get the key of the API.
- "Callback URL" specifies http://localhost:9292.
- The other items may be any values.
When registration is completed, "API key", "API secret" is acquired.
Set the obtained key to lastfm/data/token.yml.
Next, acquire Last.fm SessionID.
- Execute
lastfm/lastfm_auth.rb- Acquire the access token interactively.
Add the acquired SessionID to lastfm/data/token.yml.
key: your api key
secret: your api secret
session_id: Session ID obtained in lastfm_auth.rb
user_id: your user idCreate a lastfm log csv file with the following command.
$> ruby lastfm/lastfm.rb