使用 Google App Engine 的 Facebook 聊天机器人
我对互联网进行了很多研究,但作为新手,无能为力。 我总结了以下几点: Facebook Chat 可以通过两种身份验证来使用(通过 Facebook Chat API 官方文档):
1> X-FACEBOOK-平台 2> DIGEST-MD5
1> X-FACEBOOK-PLATFORM 方法的文档非常少,没有一个是官方的,最接近使用 pyfacebook & pyxmpp(官方 facebook 聊天 api 页面末尾有参考)。除了由此带来的调试问题之外,在 GAE 中实现这两者是另一个令人头疼的问题。不过,如某些资源中所述,创建应用程序并使用其 ID 并不是问题。 上找到了 pyfacebook 的不错的 GAE 演练
我在 riccomini.name/Topics/Web/GoogleAppEngine/FacebookConnect/ 2> 。 DIGEST-MD5是通用的用户名-密码方法,任何xmpp客户端都可以执行。所以我虽然我可以使用像 xmpppy 这样最适合我的 XMPP python 客户端库(因为我不需要高级功能)
直接回答我的问题:我的推论正确吗?我正在考虑通过方法2继续(我很清楚MD5加密密码所涉及的安全风险,请不要提醒我)。我找不到将 xmpppy 与 GAE 一起使用的参考,那么我的操作是否正确?
谁能给我提供与 GAE 一起使用的 xmpppy 的参考?
(如果我不清楚,我很抱歉。帮不上忙,我不是硅谷工程师,而是一个 15 岁的简单学生)
I digged much into internet, but being newbie, couldn't do much.
I have summed up the following :
Facebook Chat can be used via two Authentication (via Facebook Chat API official documentation) :
1> X-FACEBOOK-PLATFORM
2> DIGEST-MD5
1> X-FACEBOOK-PLATFORM Method has very less documentation, none being official, closest using pyfacebook & pyxmpp (The official facebook chat api page has a reference at the end). Implementing the both to GAE is another headache, apart from the debug problems suffered hence. The creation of apps and using its ID as stated in some resources is not a problem though. I found a nice GAE walkthrough of pyfacebook on riccomini.name/Topics/Web/GoogleAppEngine/FacebookConnect/
2> DIGEST-MD5 is the common method of username - password which can be carries out by any xmpp client. So i though i could use a XMPP python client library like xmpppy which suited me best (as i don't need advanced functions)
Coming staraight to my question : is my inference correct? I am thinking to proceed via Method 2 (Im well aware of the security risks involved in MD5 crypting of password, please don't remind me of that). I could find no refence of using xmpppy with GAE, so am I proceeding correct?
Could anyone provide me a reference of xmpppy used along with GAE ??
(I'm sorry if i was unclear. Cant help, i am no silicon valley engineer but a simple student of age 15yrs)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您无法使用 App Engine 连接到外部 XMPP 服务器,因此如果 Facebook 需要它进行聊天集成,这是不可能的。
You can't connect to external XMPP servers using App Engine, so if Facebook requires it for chat integration, this isn't possible.
GAE 有内置的 XMPP 服务。也许你可以用它来代替 xmpppy。
http://code.google.com/appengine/docs/python/xmpp /概述.html
GAE has a built in XMPP service. Perhaps you can use that instead of xmpppy.
http://code.google.com/appengine/docs/python/xmpp/overview.html
您应该查看 XEP-206 (XMPP Over BOSH),用于通过 HTTP 协议连接到 XMPP。 http://xmpp.org/extensions/xep-0206.html
我不知道 Facebook 是否支持 BOSH。
您需要 c2s 协议才能与 FaceBook 通信,因为 FaceBook 未实现 s2s 协议(联合)。
You should have a look into XEP-206 (XMPP Over BOSH) for connecting to XMPP through HTTP-protocol. http://xmpp.org/extensions/xep-0206.html
I don't know if FaceBook supports BOSH though.
You need c2s-protocol to talk to FaceBook, as the s2s-protocol (federation) is not implemented by FaceBook.