Presence As A Service - using XMPP presences for microblogging, online status displaying etc
Ruby JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
public
views
.gitignore
README.markdown
api.rb
bot.rb
config.ru
global.rb
myconfig.rb.sample

README.markdown

What is PaaS

Presence-As-A-Service (PaaS) is using XMPP presence stanzas for microblogging, online status displaying etc.

Why?

How?

Install

  • 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

Usage

  • 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

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)
  • /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

XMPP (bot commands)

  • 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.