简体   繁体   中英

XMPP, openfire and bot issue

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: autobot@mybot.com.

now a gmail user say client@gmail.com 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 client@gmail.com (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.

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.

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM