Presence-As-A-Service (PaaS) is using XMPP presence stanzas for microblogging, online status displaying etc.
- Because Google XMPP implementation sucks
- Because XMPP presences are uncomplete (missing timestamp)
- Need it for other services (ReaTiWe)
- Needed gems: eventmachine, xmpp4r, 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
- Start the bot AND the API: ruby ./bot.rb -a -p 8080
- Add the bot 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
- /last/:nick/:type - Text/image (.png) user status (status, message, timestamp)
- /atom/:nick - Atom feed with latest 10 presences (pinging PuSH hub on update)
- /photo/:nick - Return the XMPP Vcard photo ("PHOTO/BINVAL")
- /json (optional ?callback=... parameter) JSON/JSONP with latest 10 presences
- /stream and /user/:nick - demo services
- HELP, H, help, ? : List all local commands
- PING, P, ping : Connection test
- LOGIN, L, login : Register in the system
- ONLINE, O, online : Online users list
- STAT[US], S, stat[us] [JID] : Get JID status - 'away' etc.
- NICK, N, nick [name] : Change/show your nick (2-16 chars, [A-Za-z0-9_])
- MSG, M, msg {nick} {text} : Direct message {text} to user {nick}
- ON/OFF, on/off : Enable/disable presences sharing
- QUIET/VERBOSE, quiet/verbose : Trac all or only XA presences
You can make your own install, or use the status@zhware.net bot and http://status.zhware.net/ URL for API calls and to see the results.