NI-Lab.

nilog:

← 前の日 2016-07-31 次の日 →
← 一年前 一年後 →
Twitter (2016-07-31)
urllib2 for actions depending on http response codes « Python recipes « ActiveState Code http://code.activestate.com/recipes/267197/
[t] 2016-07-31 21:03:11
関連するかも情報
Python で base64

base64string = base64.encodestring('%s:%s' % (username, password))[:-1]

Basic Authentication http://www.voidspace.org.uk/python/articles/authentication.shtml
[t] 2016-07-31 21:02:51
urllib2 for actions depending on http response codes « Python recipes « ActiveState Code http://code.activestate.com/recipes/267197/
[t] 2016-07-31 21:03:11
【話題急上昇中ワード】
1. 九重親方
2. 当確
3. 当選確実
4. ウルフ
5. 出浦
6. 小池百合子当確
7. 池上
8. 秀吉
9. 大相撲
10. カツウォヌス
http://searchranking.yahoo.co.jp/realtime_buzz/ #buzzbot
[t] 2016-07-31 21:10:05
Access Token Request の redirect_uri パラメータが recommended だから指定しなかったら 400 Bad Request になりおった。

Fitbit Web API Docs https://dev.fitbit.com/docs/oauth2/#access-token-request
[t] 2016-07-31 21:21:29
{"errors":[{"errorType":"invalid_request","message":"Redirect_uri mismatch: null. Visit https://dev.fitbit.com/docs/oauth2

ぐわ。
[t] 2016-07-31 21:23:17
redirect_uri パラメータをつけたらあっさりうまくいった。
[t] 2016-07-31 21:23:48
「__str__クラスを文字列化するためのメソッド(いわゆるtoString)」

Pythonを書き始める前に見るべきTips - Qiita http://qiita.com/icoxfog417/items/e8f97a6acad07903b5b0
[t] 2016-07-31 21:33:27
Oauth access token は8時間しか保たない。

“Specify the desired access token lifetime. Defaults to 28800.”

Fitbit Web API Docs https://dev.fitbit.com/docs/oauth2/
[t] 2016-07-31 21:48:18
Python 3 の urllib で HTTP アクセスするサンプルコード。参考になる。リクエストヘッダの指定方法、Basic認証、Base64なども。

[Python] HTTP通信でGetやPostを行う http://www.yoheim.net/blog.php?q=20160204
[t] 2016-07-31 22:06:26
【話題急上昇中ワード】
1. 九重親方
2. 当選確実
3. 当確
4. 池上
5. 小池百合子当確
6. ウルフ
7. 出浦
8. 秀吉
9. 源次郎
10. 出口調査
11. 北の湖
http://searchranking.yahoo.co.jp/realtime_buzz/ #buzzbot
[t] 2016-07-31 22:10:06
import json して json.loads(JSON文字列) で Python オブジェクトに変換。

19.2. json — JSON エンコーダおよびデコーダ — Python 3.5.1 ドキュメント http://docs.python.jp/3.5/library/json.html
[t] 2016-07-31 22:16:28
Python 3 で import json と import pprint して、 pprint.pprint(json.loads(json_data_string)) で pretty printer な見やすいJSON整形。
[t] 2016-07-31 22:24:29
お手軽に使えるショートカット関数 pprint.pprint

8.11. pprint — データ出力の整然化 — Python 3.5.1 ドキュメント http://docs.python.jp/3.5/library/pprint.html
[t] 2016-07-31 22:25:33
とりあえず Python3 の標準ライブラリだけで Fitbit API から情報を取得するところはできた。 access token の期限切れ部分が実装できてないけど。
[t] 2016-07-31 22:27:14
Refreshing Tokens

Using OAuth 2.0 — Fitbit Web API Docs https://dev.fitbit.com/docs/oauth2/#refreshing-tokens
[t] 2016-07-31 22:27:26
(:3[___]
[t] 2016-07-31 22:46:05
【話題急上昇中ワード】
1. 当確
2. 当選確実
3. 池上
4. 小池百合子当確
5. 千代の富士
6. 出口調査
7. 石原伸晃
8. ウルフマン
9. 猪瀬
10. ニノフェス
http://searchranking.yahoo.co.jp/realtime_buzz/ #buzzbot
[t] 2016-07-31 23:10:05
2016年07年31日のnilogをすべて表示する

- NI-Lab.
- Mastodon (@nilab@mastodon-japan.net)
- Twitter (@nilab)
- Timelog (@nilab)
- はてなブックマーク (id:nilab)

Web Services by Yahoo! JAPAN