Created
April 14, 2011 10:41
-
-
Save aereal/919251 to your computer and use it in GitHub Desktop.
Jabber client which only do notify with Growl (requires 1.8.*)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'pit' | |
require 'xmpp4r-simple' | |
def notify(title, msg='') | |
system("growlnotify '#{title}' -m '#{msg}'") | |
end | |
config = Pit.get('jabber', :require => { | |
'username' => 'Username of jabber account', | |
'password' => 'Password of jabber account', | |
}) | |
im = Jabber::Simple.new(config['username'], config['password']) | |
Thread.start do | |
loop do | |
im.received_messages do |msg| | |
notify msg.from, msg.body | |
end | |
sleep 1 | |
end | |
end | |
sleep |
Oh, thanks :)
welcome, I'm glad to help any time ;)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you have a syntax error on line 4. it should read:
require 'pit'