🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.comp.hacker
Article #13282

Google App Engine搭建Twitter API Proxy教程

#13282
From: RSS Feed For GFW Blog
Date: Wed, 14 Oct 2009 12:39
53 lines
5336 bytes
作者:williamlong   来源:[月光博客][1]


本文将介绍如何通过Google App Engine搭建基于Python 2.5的BirdNest环境,建好的BirdNest可以在TwitterFox或twhirl中使用。

   [1]: http://www.williamlong.info/archives/1956.html

   环境准备:Google App Engine

  先要[注册Google App Engine][2],注册地址 [http://appengine.google.com/][3]
,然后建立一个application,目前第一次使用需要验证用户手机,输入手机号码就收验证码即可,之后,就可以用[yourid.appspot.com][4]来访问你的app应用。

   [2]: http://www.williamlong.info/archives/1357.html

   [3]: http://appengine.google.com/

   [4]: http://yourid.appspot.com

  此外,还需要下载安装Google APP Engine的开发环境,注意Python的版本,需要是2.5系列的,不能使用2.6或更高的版本,否则运行会出错。

  Google App Engine SDK 下载地址 [http://code.google.com/intl/zh-CN/appengine/downloads.html][5]

   [5]: http://code.google.com/intl/zh-CN/appengine/downloads.html

  Python 2.5.4 下载地址 [http://www.python.org/download/releases/2.5.4/][6]

   [6]: http://www.python.org/download/releases/2.5.4/

  关于Google App Engine的详细使用说明请参见[这个地址][7],这里我就不再累赘。

   [7]: http://www.williamlong.info/archives/1880.html

   环境准备:BirdNest

  下载birdnest要注意是下载[分支branches/gae][8],别下载主干trunk,否则更新到GAE上也不能用,会报错。可以使用一个SVN工具下载。例如[TortoiseSVN][9]等。将其放到一个目录中,进入目录,编辑app.yaml文件,将第一行的application里的参数修
改为自己的应用名。

   [8]: http://birdnest.googlecode.com/svn/branches/gae

   [9]: http://www.williamlong.info/archives/1878.html

   发布应用到GAE

  准备好了上面的一切后,就可以发布这个应用到自己的Appspot上了,执行 appcfg.py update 目录名,中间会要求输入Gmail的用户名和密码,之后就可以使用了。你创建的API地址应该是[yourid.appspot.com/api/][10] 。

   [10]: http://yourid.appspot.com/api/

   使用BirdNest

  在twhirl里的使用方法是,打开账号管理Accounts manager,选择[laconi.ca][11]账户类型,输入:[你的twitter帐号名]@[yourid.appspot.com][12],密码为Twitter密码,即可使用。

   [11]: http://laconi.ca

   [12]: http://yourid.appspot.com

   在twitterfox里的使用方法是,打开 C:\Documents and Settings\Administrator\Application Data\Mozilla\Firefox\Profiles\ 随机信息
.default\extensions\[twitternotifier@naan.net][13]\components目录,编辑 nsTwitterFox.js文件,找不到的话直接在Documents and
Settings中搜索nsTwitterFox.js文件,编辑该文件的38行,将其修改为 var TWITTER_API_URL = [http://yourid.appspot.com/api/][14] 即可。

   [13]: mailto:twitternotifier@naan.net

   [14]: http://yourid.appspot.com/api/


敬请订阅我们:http://feeds2.feedburner.com/chinagfwblog,在twitter跟随我们:http://twitter.com/cdt。翻墙工具介绍和下载:http://www.sesawe.org/和http://www.sesawwe.net/。![][15]

   [15]: https://blogger.googleusercontent.com/tracker/5500297126185736776-6805479139175376206?l=www.chinagfw.org

Contentes HTML URL: http://www.chinagfw.org/2009/10/google-app-enginetwitter-api-proxy.html

Send By Feed RSS2eMail BOT V2.65
Admin By Liuxing99
Technical Details
Message-ID: <4ad5d132$2@news.liuxing99.3322.org>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!feeder.news-service.com!weretis.net!feeder2.news.weretis.net!newsfeed01.sul.t-online.de!t-online.de!61.160.212.82.MISMATCH!www.shinco.com!news.liuxing99.3322.org!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 85629cb6ee,728786f20d2de8e6,start
X-Google-Attributes: gid85629cb6ee,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: Chinese,GB
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!feeder.news-service.com!weretis.net!feeder2.news.weretis.net!newsfeed01.sul.t-online.de!t-online.de!61.160.212.82.MISMATCH!www.shinco.com!news.liuxing99.3322.org!not-for-mail
From: RSS Feed For GFW Blog <gfwblog-list@szb66.vicp.net>
Newsgroups: cn.comp.hacker
Subject:  Google App Engine搭建Twitter API Proxy教程
Date: Wed, 14 Oct 2009 12:39:00 -0000
Organization: A poorly-installed InterNetNews site
Lines: 53
Message-ID: <4ad5d132$2@news.liuxing99.3322.org>
NNTP-Posting-Host: 58.208.7.115
Mime-Version: 1.0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: base64
X-Trace: www.shinco.com 1255526734 6182 58.208.7.115 (14 Oct 2009 13:25:34 GMT)
X-Complaints-To: news@www.shinco.com
NNTP-Posting-Date: Wed, 14 Oct 2009 13:25:34 +0000 (UTC)
Received-Path: <gfwblog-list@szb66.vicp.net>
X-Feed-By: news.liuxing99.3322.org
User-Agent: Feed RSS2eMail BOT V2.65
X-Gateway-Administrator: bianlule@bianlule.3322.org
X-Gateway-From: dnews-gateway@news.liuxing99.3322.org