-
XMPP listener
This is pretty niche so I'm not expecting too much but...
I will probably be creating a PHP/MySQL based booking system, both clients and workers will be able to communicate with this system via their phones. Client communication will be handled via SMS messages, and I will be using a service called twilio ( http://www.twilio.com ). It allows me to submit all message data to a URL of my choice and from that I can process the contents via a PHP script.
To save on costs, I would like to run a similar system for internal communications using XMPP instead of SMS. Each staff member would be "friends" with a bot account. This account will send messages to staff as well as process incoming messages. All I want the bot to do is forward each incoming message to a PHP script at a URL of my choice (much like the twilio stuff above) so I can process the contents. I'd rather have a script be responsive to incoming text messages than have a PHP script run every minute or so to check for incoming messages.
So in summary, does anyone know of an XMPP client that can forward all contents to a URL via $_GET or $_POST?
Ta!
-Chris
-
Re: XMPP listener
Ok! I think I've got something going :)
Ubuntu 12.04 Server with LAMP preset installation
Ejabberd XMPP server - http://www.ejabberd.im/
Python along with xmppy - http://xmpppy.sourceforge.net/
PHP5 along with xmpphp - https://code.google.com/p/xmpphp/
I have a python script that logs in as an account "bot" and monitors all incoming messages. Every time it gets a message it calls urllib.urlopen which runs a php script that I can use to process the message. If required I can use xmpphp to reply to the message as well. From the php script I can log all incoming and outgoing messages via a mysql database for later use in the main application.
The same PHP script is also used to process incoming SMS messages too.
I have the python script run as a service on boot by using upstart - http://askubuntu.com/questions/11849...tart-on-ubuntu
Done!
--
I've never really used python before and apart from the whole indentation with spaces requirement thing, it's brilliant :)