What is PaaS
Presence-As-A-Service (PaaS) is using an XMPP presences for microblogging, online status displaying etc.
Installation and usage
Install
- Needed gems: eventmachine, xmpp4r-simple, json, ratom, httpclient, sequel, sinatra
- Copy myconfig.rb.dist to myconfig.rb and adjust your settings
- Start the bot (this will create also database sqlite3, if missing): ruby ./bot.rb
- Start the API:
- via rackup: rackup -p 8080
- standalone: ruby ./api.rb -p 8080
Usage
- Add the bot (or use status@zhware.net with the current installation) to your roster
- PING to test the connection
- HELP to see the available bot commands
- Send LOGIN command to register (and accept the authorization request)
- Change your nick - NICK … to hide your real JID
- Enable PuSH publishing - ON
- All your presence changes will be saved - time, status, message
- To trac only some presences (extended away - XA) - QUIET
What you’ve get?
Web (HTTP services)
- /last/:nick/:type - Text/image (.png) user status (status, message, timestamp)
- /atom/:nick - Atom feed with latest 10 presences (pinging PuSH hub on update)
- /json (optional ?callback=… parameter) JSON/JSONP with latest 10 presences
- /stream and /user/:nick - demo services
XMPP (bot commands)
- HELP, H, help, ? : List all local commands
- PING, P, ping : Connection test
- ONLINE, O, online : Online users list
- ON/OFF, on/off : Enable/disable presences sharing
- QUIET/VERBOSE, quiet/verbose : Trac all or only XA presences
- STATUS, S, status : get JID status - ‘away’ etc.
- LOGIN, L, login : register in the system
- NICK, N, nick name : change/show your nick (2-16 chars, A-Za-z0-9_)