Skip to content

Instantly share code, notes, and snippets.

@ELLIOTTCABLE
Created July 28, 2008 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ELLIOTTCABLE/2950 to your computer and use it in GitHub Desktop.
Save ELLIOTTCABLE/2950 to your computer and use it in GitHub Desktop.
%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