Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
%w[rubygems ncurses xmpp4r].each {|dep| require dep }
Ncurses.keypad(@window = Ncurses.initscr, true)
Ncurses.cbreak
Ncurses.refresh
at_exit { Ncurses.endwin }
Jabber::logger = Logger.new('jabberlog.txt')
Jabber::debug = true
( @Jabber = Jabber::Client.new(Jabber::JID.new('elliottcable.testing@gmail.com/xmpp4r')) ).connect.auth('secret')
@Jabber.send Jabber::Presence.new.set_type(:available)
@Jabber.add_message_callback do |message|
@window.printw("%s", message.body + "\n")
@window.refresh
end
loop do
ch = Ncurses::getch
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment