python-box:appengine-oauth
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
python-box:appengine-oauth [2017/05/13 05:39] – [AppEngine-OAuthのソースコード] dgbadmin | python-box:appengine-oauth [2017/05/13 05:54] (現在) – [その4. TwitterにOAuthでログインしてTwitter APIを使うデモ] dgbadmin | ||
---|---|---|---|
行 63: | 行 63: | ||
''' | ''' | ||
+ | import json | ||
import logging | import logging | ||
- | import | + | import |
from appengine_twitter import AppEngineTwitter | from appengine_twitter import AppEngineTwitter | ||
from basehandler import BaseHandler, | from basehandler import BaseHandler, | ||
- | from django.utils import simplejson | ||
from google.appengine.ext import db | from google.appengine.ext import db | ||
- | from google.appengine.ext import webapp | ||
行 135: | 行 134: | ||
# ここまで来ればOAuthを使ってAPIが使える。試しにユーザー名を取得 | # ここまで来ればOAuthを使ってAPIが使える。試しにユーザー名を取得 | ||
twitter.verify() | twitter.verify() | ||
- | name = simplejson.loads(twitter.last_response.content)[' | + | name = json.loads(twitter.last_response.content)[' |
self.demo_header() | self.demo_header() | ||
行 176: | 行 175: | ||
routing = [('/ | routing = [('/ | ||
| | ||
- | application = webapp.WSGIApplication(routing, | + | application = webapp2.WSGIApplication(routing, |
- | wsgiref.handlers.CGIHandler().run(application) | + | |
</ | </ | ||
行 196: | 行 194: | ||
__author__ = ' | __author__ = ' | ||
- | __version__ = '0.2.0' | + | __version__ = '0.1.1' |
python-box/appengine-oauth.1494621557.txt.gz · 最終更新: 2017/05/13 05:39 by dgbadmin