使用Google App Engine(Python)向GTalk发送聊天邀请?

时间:2010-07-07 07:46:15

标签: python google-app-engine

如何使用Google App Engine(Python)通过GTalk发送聊天邀请,我在GAE的文档中搜索代码,但我没有得到它。由于我是Python新手,请将代码发给我......

1 个答案:

答案 0 :(得分:3)

http://code.google.com/appengine/docs/python/xmpp/overview.html

from google.appengine.api import xmpp
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app

class FooHandler(webapp.RequestHandler):
    def get(self):
        xmpp.send_invite('example@gmail.com')

application = webapp.WSGIApplication([('.*', FooHandler)], debug=True)

def main():
    run_wsgi_app(application)

if __name__ == "__main__":
    main()