Skip to content

Instantly share code, notes, and snippets.

@otsune
Created November 14, 2013 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save otsune/7463795 to your computer and use it in GitHub Desktop.
Save otsune/7463795 to your computer and use it in GitHub Desktop.
http://www.healthplanet.jp/apis/api.html
タニタの体組成計のSDカードからデーターを投稿するアプリがWindowsにしか対応していないけど、このAPIみたらOauth2.0でXMLかJSON投げりゃ投稿できるっぽいな。
SDカードの中をみたらTANITA/DATA1.CSVに計測ごとに1行追記してるだけだし。
urn:ietf:wg:oauth:2.0:oob でコマンドラインスクリプト走らせりゃ済みそう。
---
アプリ登録して
https://www.healthplanet.jp/oauth/auth?client_id=[CLIENTID]&redirect_uri=https://www.healthplanet.jp/success.html&scope=innerscan&response_type=code
で認証してaccess_code貰って
curl --request POST -d client_id=[CLIENTID] -d client_secret=[CLIENTSECRET] -d redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob -d code=[ACCESSCODE] -d grant_type=authorization_code https://www.healthplanet.jp/oauth/token
でtoken取って
curl -d access_token=[TOKEN] -d date=1 -d tag=6021,6022 https://www.healthplanet.jp/status/innerscan.json
したら表示できた。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment