jm.rb

Author: Jakob Schmid (see http://www.schmid.dk/ for contact information)
Version: 0.1.0
Revision: 3200
Date: 2008-06-23

Introduction

jm.rb (Jabber Message) sends a XMPP (the Jabber protocol) message from the command-line.

Features

  • Fully configurable through ~/.jmrc

Installation

Requirements

  • Ruby.
  • RubyGems: xmpp4r, getoptlong

Download

jm.rb 0.1.0 (2008-06-23) tarball (? KB)

Install

Copy jm.rb to /usr/local/bin or somewhere in your path.

Documentation

Usage

jm.rb is really simple to use. When you start it for the first time, it creates a configuration file ~/.jmrc , in which you can enter your account information. Then you can run it like this:

jm.rb hello

I also use it for reminders, e.g.:

sleep 180;jm.rb 'tea is ready'

Other Applications

It can also be used with cron, like this:

34   11     *     *     1-5  /usr/bin/ruby -rauto_gem /usr/local/bin/jm.rb hello

Or with procmail, like this:

SUBJECT=`cat | egrep "^Subject:" | sed -re 's/^[Ss]ubject: *//'`
FROM=`cat | egrep "^From:" | sed -re 's/^[Ff]rom: *//'`

:0 c # continue after this rule
| /usr/bin/ruby -rauto_gem /usr/local/bin/jm.rb "You've got mail from ${FROM}. Subject: ${SUBJECT}."

Syntax

Usage: jm.rb [CONTACT] [MESSAGE]

Send instant message using XMPP (Jabber). If message is omitted,
message is read from stdin.
CONTACT is something like someone@somewhere.org

Options:
  -h, --help       this help message
  -v, --verbose    verbose output
Usage: jm.rb [CONTACT] [MESSAGE]

Known Bugs

None.

Changelog

jm.rb 0.1.0 (2008-06-23)

  • First version. I have used it for a while, and it seems to work.