Google App Engine(for Python)でtwitterにPostするためのコード。 ベタ書きだとこのあたりが最小構成なのかしら。 本当はクラスライブラリみたいなのにしたりIDとパスワードは別ファイルにおいて読み込んだりするといいんだけどついついコードを直に埋めてしまうのが自分の悪い癖。 from google.appengine.api import urlfetch import base64 import urllib header_auth = { 'Authorization' : 'Basic ' + base64.b64encode('%s:%s' % ('YourTwitterID', 'YourTwitterPass')) } status = u'ほげほげ' url = 'http://twitter.com/statuses/update.json'