Skip to content

Instantly share code, notes, and snippets.

@bopm
Created May 3, 2011 10:59
Show Gist options
  • Save bopm/953161 to your computer and use it in GitHub Desktop.
Save bopm/953161 to your computer and use it in GitHub Desktop.
jabber simple script
#!/usr/bin/env ruby
require 'rubygems'
require 'xmpp4r-simple'
message = ""
to = ARGV.delete_at(0)
ARGV.each do |a|
message << "#{a}\n"
end
im = Jabber::Simple.new("login@host", "password")
q = im.deliver(to, "#{Time.now}: #{message.gsub("\n"," ")}", :headline)
# wait a little for relay to complete
sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment