Skip to content

Instantly share code, notes, and snippets.

@zuchmanski
Created June 6, 2010 17:19
Show Gist options
  • Save zuchmanski/427725 to your computer and use it in GitHub Desktop.
Save zuchmanski/427725 to your computer and use it in GitHub Desktop.
require "rubygems"
require "xmpp4r-simple"
require "session"
USERNAME = "sebcioz@v-lo.krakow.pl"
PASSWORD = "*"
im = Jabber::Simple.new(USERNAME, PASSWORD)
sh = Session::new
im.add("sebcioz@gmail.com")
im.deliver("sebcioz@gmail.com", "Hi")
loop do
im.received_messages do |msg|
stdout, stderr = sh.execute(msg.body)
pwd = sh.execute("pwd")
im.deliver("sebcioz@gmail.com", stdout)
im.deliver("sebcioz@gmail.com", "=> #{pwd}")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment