Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Add Comment
Please, Sign In to add comment