2015年6月27日土曜日

Javascript: 文字列→数値変換

http://lealog.hateblo.jp/entry/2013/02/28/005010

Javascript: CSVファイルの読み込み

http://home.a00.itscom.net/hatada/js01/ajax/ajax01.html

Python: バックスラッシュの表示

ダブルバックスラッシュ
http://jutememo.blogspot.com/2008/10/python-row-stirng.html

Python: 文字列置換

replace
http://orangain.hatenablog.com/entry/20100503/1272900555

SQLite: データベースのデータ構造を確認する

とりあえず全部ゲットならnameのところをアスタリスクに
http://stackoverflow.com/questions/305378/get-list-of-tables-db-schema-dump-etc-in-sqlite-databases

項目別のリスト
http://program.station.ez-net.jp/special/sql/sqlite/columns.asp

HTML: 一定時間でリロード(Refresh)

http://www.tagindex.com/html_tag/page/meta_refresh.html
metaデータを使う

HTML: キャッシュのクリアについて

だいたい書いてあることは同じ
http://qa.atmarkit.co.jp/q/6365
 http://hungred.com/how-to/tutorial-stop-caching-jquery-javascript/

で、クエリーを変更する(「違うファイルですよー」)も常套手段
http://yuki.silk.to/2006/04/000170.html

jQuerryを使うのは試していない
http://www.koikikukan.com/archives/2011/08/29-015555.php

2015年6月12日金曜日

Mac, shellスクリプトで自動スクリーンショット

screencaptureを使って60秒毎にスクショを取るサンプルコード
http://yumulog.hatenablog.com/entry/2014/10/30/230110

screencaptureコマンドの詳細
http://qiita.com/South_STR/items/f4624134726eca839647

Python, Facebookページに投稿する

このチュートリアルがシンプルでわかりやすい
http://nodotcom.org/python-facebook-tutorial.html
よくあるエラーの一例
http://stackoverflow.com/questions/8823049/facebook-graph-api-error
'publish_stream'とここでは書いてあるが'publish_pages'のことだと思われ(バージョンの問題かな)

このexampleに従うと「自分のアカウント」で投稿する
http://stackoverflow.com/questions/24052651/python-facebook-sdk-post-to-page
そのときのエラーの一例
http://stackoverflow.com/questions/19535885/oauth-exception-200-while-trying-to-post-to-groups-after-recent-facebook-mainte
「アプリの設定」でアプリ自体のpublicへの投稿を許可しておく必要がある(only meではダメ)

Facebookページへの写真投稿についてはハマった
HTTPのリクエストを自力で作るやつが結果的には容易だった
http://stackoverflow.com/questions/17691636/uploading-photos-or-videos-to-facebook-using-python
ここにあるのはvideosの例だけどphotosに書き換えればよい
あとは前述のこれ、
http://nodotcom.org/python-facebook-tutorial.html
のサンプルへの注記にあるようにappへのaccess tokenではなく、Facebookページに対するaccess tokenをゲットすればページ管理人として投稿できる

参考Graph APIのphoto部分のリファレンス
https://developers.facebook.com/docs/graph-api/reference/page/photos/ 

Facebook-SDKのリファレンス(post_wallはいいんだけどput_photoは使えなかった)
http://facebook-sdk.readthedocs.org/en/latest/api.html#put-photo
リファレンス全体(root node)
https://developers.facebook.com/docs/graph-api/reference/

http://facebook-sdk.readthedocs.org/en/latest/api.html#class-facebook-graphapi