Search posterous

Search all posts and users. Type a name, type a favorite song title, whatever! See what comes up.
  

More posterous blogs











More recommended blogs »

Here are posterous posts filed under gae...

Kinlan says...

Ahoyo is hosted on the Google App Engine so we are pleased to announce that we have launched App Engine News for Android phones.

A bit of blurb about App Engine News:

If you want to stay up to date with the very latest App Engine News on your Android phone, then this application is for you.

It combines hot off the press news and insight with video, social media, images and much much more to give you instant access to .

This application was built and deployed using the Ahoyo MAF (Mobile Application Framework) and will be available for the iPhone shortly (It is in the review queue).

If you would like your blogs, youtube feeds or if you have any excellent twitter users and lists that we must include in this application please get in contact, we are keen to expand this excellent resource.

Stay tuned for even more great applications.

Filed under: gae

Adios says...

Robot Versioning

Robots within the Wave API are versioned. This allows the Wave system to detect when robots have changed and/or their capabilities have been altered. If you modify a robot's capabilities (by adding or removing monitored events, for example), you should also modify the version identifier in the Robot's constructor.

When deploying a robot, the Wave system will check if the robot identifer is different than what it has cached. (The robot identifier is simply a text string.) If so, Wave will refresh the robot and alter the system to generate any new events you've indicated interest in.

app.yaml 的 version 是應用程式的版本,每個版本的檔案會被 GAE 給記起來,所以可以輕易回復到之前的版本。

而 robot 的 version 這個參數則是指定 robot 的 capabilities.xml 是否有變更,若你為這個 robot 新增了一些 event handler,對應的 capabilities.xml 也會更新,就要告訴 GAE 你要重新 cache 新的。

Filed under: gae

John says...

If you are a familiar with Ruby, not familiar with Python, and looking to get your feet wet with Google App Engine & Python, this might be helpful.

I have about 20 hours of Python experience at this point, so take everything I write here with severe skepticism.

I am used to using various test/spec suites when coding Ruby projects, and I wanted something to do just that with Python and GAE.

After installing Google App Engine, the tools you want will be

nose, a unit testing framework
http://somethingaboutorange.com/mrl/projects/nose/0.11.1/

NoseGAE, nose plugin for creating an GAE environment
http://farmdev.com/projects/nosegae/

autonose, similar functionality to ruby's autotest
http://github.com/gfxmonk/autonose

After you have created some tests in , ROOT/tests

`nose --with-gae`

To run autonose I use

`autonose --console -x --with-gae`

Happy coding...

Filed under: gae

kang says...

前两天,一时兴起,做了个发布3P(PPPerson板)的帖子到Twitter帐号的应用,下面讲讲其中的一些细节。

另外:目前这个帐号是 @PPPerson ,经过几天的测试,目前调整为只读取PPPerson板的帖子,每贴发两图到twitpic

1.使用feedparser读取水源的3P板feed,将feedparser的encoding自动设为gb2312,这个很重要,否则title读出来乱码

2.判断文章是否读取过,检查数据库即可

3.对于新的文章,去掉文章中的签名档

4.使用从SGMLParser继承下来的自己写的类,读取文章中的img

5.使用Google App Engine新出来的task queue功能,将单个图片的处理添加到队列中。注意,千万不能在一个地址里处理很多图片,现有要遇到quota。

6.使用twitpic的Python类库,将下载下来的Pic传到twitpic.com上面

7.使用App Engine的cron,定期检查水源3P板的新文章

Filed under: GAE

Chjingshui says...

GAppProxy是 现在用得比较广泛的代理服务器软件,相信经常“翻墙”的同学也一定使用过它吧,其实为了防止整个网络都处在VPN中、又没钱搞SSH,GAppProxy 的确应该算得上是首选了吧。但是有一个问题,GAppProxy的默认服务点非常拥挤,用的人一多就没有流量可用,因此有必要给自己架设一个 fetchServer(服务点),我们可以非常轻松地通过Google App Engine(GAE)做到。如果觉得一头雾水的同学可以先看博文最后的“扫盲部分”。话不多说,开始我们的小小教程。

第一步:注册GAE

这 一步需要一个google帐号,首先登陆Google App Engine(GAE) 注册应用,登陆之后点击“Create an Application”,然后会有一个必须的短信验证的过程,填写自己的手机号码(国产手机+86)等待验证码即可。最后便是以上的页面,需要填写 Application Identifier (建议填写你的google账号)和 Application Title(随意),保存后就完成了。

第二步:安装各类软件

需要的软件有:PythonGoogle App Engine SKD (点击下载)

注:GAppProxy是用Python编码的,因此安装Python的目的是为了读取开源文件。Google App Engine SDK是GAE的软件开发工具包,必须安装,因为之后要上传文件至GAE。

当然啦GAppProxy这个软件还是必须的,所有设置完成后还得靠它运作呢,这个应该事先就安装好的吧?

第三步:配置文件

需要的压缩包有: fetchServer (点击下载)

注:GAppProxy是开源的软件,而fetchserver则是GAppProxy服务端源码包。如果要架设自己的fetchServer,可以下载并上传至自己的GAE。

将下载的fetchserver解压缩到Google App Engine SDK的安装目录下,即:X:\Program Files\Google\google_appengine\fetchserver (注意问文件夹的命名和路径),然后用记事本打开fetchserver目录下的app.yaml 文件,把“ your_application_name ”修改为你刚才注册的 Application Identifier,然后保存。最终app.yaml的内容应该是这样的:

application: yourname
version: 1
runtime: python
api_version: 1
handlers:
- url: /fetch.py
script: fetch.py
- url: /admin.py
script: admin.py

第四步:上传文件至GAE

再完成了简单的配置之后,就是将fetchServer上传到GAE了,上传的方法如下:


打开命令提示符(开始 > 运行 > cmd),输入 cd X:\Program Files\Google\google_appengine\  回车(进入Google App Engine SDK的安装目录),最后输入以下命令行:appcfg.py update fetchserver,回车,这时会要求你输入 Google 账户及密码,之后会自动上传文件。这步非常容易出错,要细心一点。

上传完毕后,打开自己的GAE检测是否上传成功,检测地址是 http://yourname.appspot.com/fetch.py ,而我自己的则是 http://wintbros.appspot.com/fetch.py ,看到以下界面则表示已经成功。


第五步:设置GAppProxy,享受代理乐趣

所有的准备工作都已经完成了,以上获得的http://yourname.appspot.com/fetch.py就是你的私人fetchServer地址,现在所要做的就是打开你的GAppProxy,点击GUI.EXE文件,将其中的“use fetchserver”一栏填写为自己的fetchServer地址,然后重新启动GAppProxy即可,如下图所示,点击“status”显示为“proxy is running”就表明已经成功设置了。


接 下来的事情,就用各种浏览器去设置代理吧,代理设置为127.0.01:8000(本机设置),非常地简单易用,接着就可以代理上网了,这个时候你会发现 你的ip已经变成美国的啦(因为GAE在美国的关系),什么twitter、facebook、wiki,尽情享受上网冲浪的乐趣吧!如果说浏览器设置代 理上网实在不会的同学请看这里

扫盲部分:

  • GAppProxy 是什么?
    GAppProxy 是基于 Google app engine,为教育网用户提供一个免费的国际代理。由于借助了 Google 强大的服务器,所有也适用于公网的代理。
  • Google app engine 是什么?
    Google app engine 是 Google 提供的一个在线应用程序平台,支持 Python。简单的说是在 Google app engine 上面直接运行用 Python 写的程序,由 Google app engine 提供网络空间和带宽。
  • 用 GAppProxy 能干什么?
    如果你在教育网,你可以把 GAppProxy 当作一个国际代理服务器,类似搜狗浏览器的教育网加速。
    如果你在公网,正常情况下用不到 GAppProxy,但如果想访问某些低俗网站,还是用得到的。

Filed under: GAE

kang says...

前几天开发Posterous-Robot的时候,研究了下Google Wave Client Library,Google目前提供Python和JAVA语言。但是,Python类库的功能明显没有JAVA类库的全。

我们还能看到,Google App Engine推出JAVA版本之后,更新很快,功能上,几乎马上跟上了Python版的速度。

以上两件事,我们可以得出如下两个结论:

1.Google内部,Python和JAVA语言很主流。

2.Google内部,JAVA工程师比Python多不少。

当然,以上都是臆断,不过从开发的速度上来看,JAVA确实更加主流。上次给大家介绍了codereview.appspot.com,这个网站的发起者是Google里面review Python代码最多的人,大家可以去看看。

Filed under: GAE

pochi says...

ひとまず超基本をメモっとこ.

 

・Google App Engine SDK

http://code.google.com/intl/ja/appengine/downloads.html
GoogleAppEngine_1.2.0.msi をDL

・GAE/Pythonのスタートガイド
http://code.google.com/intl/ja/appengine/docs/python/gettingstarted/

・Google App Engine SDKのインストール
GoogleAppEngine_1.2.0.msiを実行.
C:\Program Files\Google\google_appengineにインストールされる.

・パスを通しておく
set Path=%Path%;C:\Program Files\Google\google_appengine\

・デモプログラムを実行してみる
cd C:\Program Files\Google\google_appengine\
dev_appserver.py demos\guestbook
ブラウザでhttp://localhost:8080/にアクセスするとゲストブックアプリが見れる.

・Hello Google App Engine(Local)
とりあえず置き場を作る.
cd C:\Program Files\Google\google_appengine\
mkdir application
cd application
mkdir HelloGAE
app.yamlとhelloGAE.pyをHeeloGAEの下にぶち込む
----app.yaml----
application: helloGAE
version: 1
runtime: python
api_version: 1

handlers:
- url: /.*
 script: helloGAE.py
----helloGAE.py----
# -*- coding: utf-8 -*-
def main():
 print 'Content-Type: text/plain'
 print ''
 print 'HelloGAE'

if __name__ == "__main__":
 main()
if __name__ == "__main__":
の意味はメインアプリケーションとして実行してるときだけ実行されるということ.
importでインポートされたときは__name__が__main__ではないため.

ローカルサーバに設置
dev_appserver.py application/helloGAE
http://localhost:8080/にアクセスするとHelloGAEが表示される.

・GAE上に設置
http://appengine.google.com/にアクセスし,サインインする.
Create an Applicationボタンをクリック
 ↓
Verify Your Account by SMS画面
自分の国とキャリアを選択してusernameにメアドの@の前を入れてSend
携帯に認証コードが書かれたメールが届くので,Enter Account Code:のところに入れてSend
 ↓
Create an Application画面
ApplicationIdentiferにはhellogae090720とかかぶらないようなIDを入れてCheck Availableを押してYesならOK
Application TitleにはHelloGAEとか入れておく
I accept these termsにチェックを入れてSave

app.yamlの修正
application: hellogae090720
に修正

GAEにデプロイ
appcfg.py update application\helloGAE

アクセス
http://hellogae090720.appsport.com/

次はGAEが用意してるモジュールってかwebappフレームワーク絡み。

Filed under: GAE

riduidel says...

So, now my friends of the front-end team are starting to build walls, I think it's time for the server team to wake up from its eons long sleep, deep in the walls of the fabulous R'lyeh city.So let's start by some general considerations.

As mentionned in the wiki, one of the most required features is the ability to save scores server-side, and to comapre score between players in a (expected social) way (like, say, using geoip to get scores of players nearby).
To implement these features, our team has decided to rely upon, some buzzwords (which, in fact, can be considered as some serious players in their games) :
  • Google app engine for the infrastructure, hosting, admin, ... Indeed, we know that JavaEE free hosting providers are not that many. And we also know we will use Java for server-side. Obviously, there are more "modern" and "dynamic" languages. However, after having used them on other attempts, we know their dynamism come at the cost of maintainability (yep, this is a troll).
  • So we'll use Java on server
  • And, since we want to communicate with a client, we rely upon a REST architecture, implemented using restlet.
So, here are our bricks. Now come the hard part : how will we link them together ? Let REST it ...
In first multiplayer steps, user will have its score saved for each game it plays, so we will have to have a PUT with player name, game name, and score.
Obviously, a second call should be able to send last scores, and scores around player (say the 100 before and the 100 after).
Finally, since we rely upon Google architecture, and since we want to be good google-tizens, we may implement a request limiter, maybe based upon some restlet features ... But this will be the subject of an upcoming post.

Filed under: gae

hdknr says...

覚書など

  • いまだにXPathもついでにDOMもよく把握していないので、きっと動作は怪しいと思います(をい)*1
  • 一応、
    http://svn.coderepos.org/share/lang/javascript/javascript-xpath/trunk/test/functional/data/
    を使った試験はしています。
    2009/3/24現在のデータ(0000~0012)において、0002のうちの2つがNG、あとはOKとなっています。
    0002でNGなのは、'.//blockquote/text()'と'.//blockquote/node()'。
    BeautifulSoupの特性なのか、'<...>\n    <...>'のようなHTMLがあった場合、テキストノードとして後ろのタグ前のスペースが無視されてしまう模様。根が深そうなので対応困難っぽいです…。
  • アーカイブファイルには試験用スクリプト(TEST_BSXPath.py)と、まとめて試験する用のWindowsコマンドプロンプト用バッチファイル(testbsx.cmd)(とそのテスト結果)を同梱しています。
    バッチファイルを実行すると".\testbsxresult"フォルダを作ってその中に結果を保存します。
  • BeautifulSoupは3.1.0*よりも3.0.7*の方が、Parseエラーが出にくいようです。
    Currently the 3.0.x series is better at parsing bad HTML than the 3.1 series.
  • 速度的な面は期待しないで下さい。結構遅いかもです。速くする方法があったら教えて下さい。
  • Pythonも初心者なので、かなりおかしな書き方をしていると思われます。こうした方がよいというアドバイスは歓迎です。

PyXMLもlxmlもだめなので、BeautifulSoupですか。

Filed under: GAE

hdknr says...

Reported by kumar.mcmillan, May 30, 2009
To use Crypto in the SDK you have to install it globally into
site-packages.  A natural tendency of lazy developers is to run 
easy_install pycrypto.  This installs the Crypto module just fine but the
dev_appserver.py still raises an ImportError which is a bug.

For *users*: here is a temporary workaround:

# delete the egg:
sudo rm -fr
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pycrypto-2.0.1-py2.5-macosx-10.3-i386.egg/

# install it the slightly-less-easy way:
wget
http://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.0.1.tar.gz#md5=277aa00f27cfbb08f21063f4beb6de59
tar -xzf pycrypto-2.0.1.tar.gz 
cd pycrypto-2.0.1
python setup.py build
sudo python setup.py install


If you want to consider fixing this for the SDK, it should be pretty easy
to do.  Here are a few lines of code you can add to dev_appserver.py around
line 819 just before ALLOWED_SITE_PACKAGE_FILES


  try:
      import Crypto as _CryptoTest
      # I.E. pycrypto-2.0.1-py2.5-macosx-10.3-i386.egg/Crypto
      _CryptoBase = os.path.dirname(_CryptoTest.__file__).replace(
            os.path.join(os.path.dirname(os.__file__), 'site-packages'), 
            "")[1:] # removes preceding slash
  except ImportError:
      _CryptoBase = "Crypto"

Then, the subsequent hard-coded strings "Crypto" can be replaced with
_CryptoBase.  I would not recommend using pkg_resources.require('pycrypto')
to find the path since that would introduce setuptools magic.

Filed under: GAE