XMPP、openfire 和机器人问题
我有兴趣制作一个聊天机器人。我的脚本目前与 imified.com 机器人运行良好。然而imified几乎每天都在下降。所以我正在寻找自己的解决方案。
在我的发现过程中,我发现(通过这个网站)openfire 并且我已经配置了它,即使对于 gmails 用户它也能正常工作。
但我仍然没有得到我需要的东西。
当每个 gmail 或其他外部用户向我发送消息时,我需要请求一个 URL(包含聊天脚本和 imified 等提供的其他一些用户数据)。让我解释一下。
我的 openfire 托管并为 mybot.com 工作,我的 id 是: [电子邮件受保护]。
现在,一个 Gmail 用户说 [email protected] 在他的 gtalk/piding 中添加了我我们可以互相交流。他可以给我发消息,我可以回复。
但我需要一个机器人来代替我。当[email protected](以及任何其他用户)向我发送消息时,我需要请求一个 URL,以便我可以根据他/她发送的消息动态生成响应。
我应该采取什么方式来实现这一目标?有没有办法自定义 openfire 来做到这一点?
或者我应该制作一个 php/python (不过我需要学习 python)脚本来监听 xmpp 端口并生成响应?如果是这样,有什么有用的脚本可以指导我吗?
非常感谢您阅读它,并提前感谢您提供任何回复。
I am interested to make a chatbot. My script is currently working fine with imified.com bot. however imified is down almost everday. so i am looking for my own solution.
during my findings, I have found (through this site) openfire and I have configured it and it is working fine even with gmails users.
but i am still not getting what I need.
I need to request a URL (with the chat scripts and some other user data something like imified provides) when each gmail or other external users send me a message. let me explain.
my openfire is hosted and working for mybot.com and my id is: [email protected].
now a gmail user say [email protected] added me in his gtalk/piding and we can communicate each other. he can send me message and I can reply.
but I need a robot instead of me. when [email protected] (and any other user) sends me a message, I need to request a URL so that i can dynamically generate response based on the message he/she sent.
in which way I should go for achieving this? Is there any way to customize openfire to do so?
or should I make a php/python (i need to learn python though) script that will listen to xmpp ports and generate responses? if so, any helpful scripts that may guide me?
bunch of thanks for reading it and thanks in advance for providing any response.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
OpenFire 理解 XMPP,您需要的是 XMPP 库/API(如果您是 Rubyist,则像 XMPP4R)。使用它,您的应用程序将登录 OpenFire(通过发送 gmail/yahoo 凭据),其他人将看到您在线。但是,当他们回复您时,您会在申请中收到通知。您可以在其中接收消息、处理消息并发送响应(通过编写所需的程序/逻辑)。
我们已经在 SMS 聊天应用程序中与 Gmail/Yahoo Messenger 好友/联系人完成了此操作。
The OpenFire understand XMPP, what you need is XMPP library/API (like XMPP4R if you are Rubyist). Using it your app will login to OpenFire (by sending gmail/yahoo credentials) and others will see you as online. But when they will reply to you, you will be notified in your application. Where you can receive the message, process it, and send response (by writing a required program/logic).
We have done it in our SMS Chat application with Gmail/Yahoo messenger friends/contacts.
Openfire 是 XMPP 服务器。它是 XMPP 客户端之间的路由消息。
您需要 XMPP 客户端来连接到服务器并处理来自其他客户端的消息。
例如,您可以查看此处。该页面包含两个简单的机器人。
Openfire is XMPP-server. It's route messages between XMPP-clients.
You need XMPP-client which connects to server and process messages from other clients.
For example you can look here. That page contains two simple bots.
您还可以使用 xmpp js lib 'strope'
https://github.com/metajack/stropejs
和xmpp python lib
https://github.com/fritzy/SleekXMPP
和 xmpp php lib
https://github.com/alexmace/Xmpp
尝试一下,祝你好运
you can also use xmpp js lib 'strophe'
https://github.com/metajack/strophejs
and the xmpp python lib
https://github.com/fritzy/SleekXMPP
and the xmpp php lib
https://github.com/alexmace/Xmpp
have a try and good luck
您可以尝试我们的 XMPP 聊天机器人,它已经过 openfire 测试:
http://github.com/gbin/err
设置起来非常简单,并且只需要打个招呼即可world 插件非常简单,无需操作 XMPP :
请参阅 https://gist.github.com/2902497
You can try out our XMPP chat bot, it has been tested with openfire :
http://github.com/gbin/err
It is super easy to setup, and making a minimal hello world plugin is quite easy, no need to manipulate XMPP :
see https://gist.github.com/2902497