Created
December 3, 2008 07:19
-
-
Save zh/31454 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'xmpp4r' | |
include Jabber | |
unless ARGV[0] | |
p "Usage: #{$0} MSG" | |
exit | |
end | |
FROM = 'change-me@server.tld/Console'.freeze | |
PASS = '--change-me--'.freeze | |
TO = 'juick@juick.com'.freeze | |
c = Client::new(JID::new(FROM)) | |
c.connect | |
c.auth(PASS) | |
c.send Message::new(TO, ARGV[0].to_s).set_type(:normal) | |
# some older servers will not send the message if you | |
# disconnect immediately after sending | |
sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment