GAE上oauth2 (Python模块)的替代方案



从我在GAE上运行的应用程序,我希望能够定期发布tweet。

我有一个代码,我可以从localhost发布推文。

import urllib
import urllib2
import simplejson as json
import oauth2 as oauth 
consumer_key = ""
consumer_key_secret = ""
oauth_token = ""
oauth_token_secret = ""
consumer = oauth.Consumer(key=consumer_key, secret=consumer_key_secret)
access_token = oauth.Token(key=oauth_token, secret=oauth_token_secret)
client = oauth.Client(consumer, access_token)
url = "http://api.twitter.com/1/statuses/update.json"
data = {'status': 'post this'}
response, data = client.request(url,'POST',urllib.urlencode(data))

由于oauth2库在GAE上不可用,我想知道能够在GAE上运行代码的最简单方法。

oauth2是一个纯python模块;它应该运行良好的应用引擎-只需捆绑它与您的应用程序。

您可以检查这个示例。需要上传oauth2文件夹与您的源代码。

相关内容

最新更新