使用Python或Go创建一个与Google Talk集成的聊天机器人。

huangapple go评论103阅读模式
英文:

Creating a chat bot integrated with Google Talk preferably in Python or Go

问题

这个问题在不同的时间以不同的形式被问过,但由于时间的变化和现有的答案并不令人满意,我允许自己再次提问,

我想要实现一个聊天机器人,让我们的团队能够回答问题和接受命令(类似于Github的hubot),我想在Google Talk服务(即Gmail和其他地方的聊天服务)的基础上实现这个功能,而且我更愿意使用Python或Go语言,在AWS上进行开发(而不是使用Google App Engine)。

我的问题是,是否有任何在过去一年中一直在积极开发的Python或Go的Google聊天客户端库?对于实现聊天机器人的任何建议都将非常感激。

我的计划是拥有一个Google Talk客户端,始终运行并等待人们与其交谈,并解释他们的消息/命令(而不是运行一个服务器并处理用户身份验证等问题)。

英文:

This question has been asked in different forms at different times,
But since things have changed quite a bit over time, and the existing answers are not very satisfactory to begin with, I permit myself to ask it again,

I want to implement a chat bot, for our team to be able to answer queries and accept commands (something roughly speaking like Github's hubot), I want to do this on top of Google Talk Service (the chat service which is inside Gmail and elsewhere), and I'd rather do it in Python or Go, on AWS (as opposed to using Google App Engine),

My question is there any Google chat client library in python or Go out there, which has been in active development in the past year?
Any suggestions regarding implementation of a chat bot is greatly appreciated.

My Plan is to have a Google talk client, running all the time that waits for people to talk to it and interpret their messages/commands (as opposed to running a server and dealing with user authentication and ...)

答案1

得分: 3

谷歌聊天服务基于XMPP,但使用了一些开放但非标准的扩展,尽管这些扩展不是必需的来建立连接。任何符合标准的客户端都应该可以工作。

引用自https://developers.google.com/talk/open_communications#developer

我是一个即时通讯客户端的开发者。我如何连接到谷歌聊天服务?

只要你遵守XMPP规范的要求,你就可以连接到谷歌聊天服务。

除了支持XMPP-Core和XMPP-IM之外,连接到谷歌聊天并没有什么特别之处。出于传统原因,它甚至支持SASL PLAIN机制。

目前Go语言中没有很好的XMPP支持,有几个项目正在进行中,但都远未达到生产就绪的状态,而且许多项目已经被放弃。选择其中一个已经成熟的Python库是你最好的选择。

在没有过多考虑的情况下,我会选择Twisted Words或Wokkel。

英文:

The Google Talk service is based on XMPP but uses some open but non-standard extensions although none of these are required to establish a connection. Any standard compliant client should work.

Quote from https://developers.google.com/talk/open_communications#developer
> I am a developer of an IM client. How do I connect to the Google Talk
> service?
>
> As long as you adhere to the requirements of the XMPP specs, you will
> be able to connect to the Google Talk service.

There nothing special, short of supporting XMPP-Core and XMPP-IM required to connect to Google Talk. It even supports SASL PLAIN mechanism for legacy reasons.


There is no good XMPP support in Go at the moment, several irons in the fire so to speak but all far from production ready and many abandoned projects. Going with one of the established Python libraries is your best bet.

Without putting too much thought into it I would go with Twisted Words or Wokkel

答案2

得分: 2

唯一可能符合条件且我知道的是 mattn / go-xmpp

英文:

The only thing which might qualify and I'm aware of is mattn / go-xmpp.

答案3

得分: 2

Google Talk使用普通的XMPP(http://www.xmpp.org),唯一的区别是它需要非标准的身份验证方案作为客户端登录到他们的服务器(当时是X-GOOGLE-TOKEN SASL机制,现在似乎是OAuth2) - 与gtalk服务器之间的服务器通信可以正常工作,无需任何调整。

请注意,您也可以考虑设置自己的XMPP服务器,因为有许多免费的XMPP服务器(ejabberd,prosody,openfire,jabberd2),并且有免费的XMPP启用的Web聊天客户端(其中一个例子是JWChat),以防您想要启用人们直接从Web界面聊天。

至于库,我听说在编写Python的网络应用程序时使用Twisted框架很时髦,所以看看有什么可用的。@jnml提到的go-xmpp似乎还不支持核心XMPP RFC中指定的最低要求。

英文:

Google Talk uses plain XMPP <s>with the only twist is that it requires non-standardized authentication schemes to log into their servers as a client (back then it was X-GOOGLE-TOKEN SASL mechanism, and now it's supposedly OAuth2)</s> &mdash; server-to-server communication with gtalk servers works without any tweaks.

Note that you might as well consider setting up your own XMPP server as there are many free XMPP servers (ejabberd, prosody, openfire, jabberd2), and there are free XMPP-enabled web chat clients (with JWChat being one example) in case you'll want to enable people to chat directly from the web UI.

As to libraries, I heard it's fashionable to use the Twisted framework when writing network-enabled applications for Python, so look at what's available. go-xmpp mentioned by @jnml does not appear to support even the bare minumum requirements specified in the core XMPP RFC yet.

huangapple
  • 本文由 发表于 2013年2月6日 22:44:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/14731742.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定