daily pastebin goal
94%
SHARE
TWEET

Untitled

a guest May 27th, 2018 270 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require "rubygems"
  2. require "xmpp4r-simple"
  3. require "session"
  4.  
  5. USERNAME = "sebcioz@v-lo.krakow.pl"
  6. PASSWORD = "*"
  7.  
  8. im = Jabber::Simple.new(USERNAME, PASSWORD)
  9. sh = Session::new
  10.  
  11. im.add("sebcioz@gmail.com")
  12. im.deliver("sebcioz@gmail.com", "Hi")
  13.  
  14. loop do
  15.   im.received_messages do |msg|
  16.     stdout, stderr = sh.execute(msg.body)
  17.     pwd = sh.execute("pwd")
  18.     im.deliver("sebcioz@gmail.com", stdout)
  19.     im.deliver("sebcioz@gmail.com", "=> #{pwd}")
  20.   end
  21. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top