Gmail Notification via google talk XMPP
GmailNotify
Gmailにメールが届いたら、Growlで通知する
Mac版のGoogleTalkが存在しないので、Rubyで通知機能を作った。
require 'gmailnotify.rb'
xmpp_client = GmailNotify.new("[email protected]", "++password++") xmpp_client.start
1: xmpp4rライブラリ。 (gem install xmpp4r) 2: growl + growlnotify (http://growl.info/extras.php#growlnotify)
iChatでチャットはできるが、メール通知ができない。 Google Talk = +
MachではiChat = <Jabber Client> である。 Gmail通知がないと、Mac環境ではGoogleTalk同等にならない。
そこで rubyで実装した。
Google Talkにはメール受信をXMPP経由での通知機能がある。
メール着信時に通知を受けるので、とてもレスポンスがリアルタイム。 もともとXMPPというチャット用のプロトコルなので、通知が速い。
xmpp4rの問題点、Thread#abort_on_exception=true を使い倒す なので、エラーのキャッチが面倒。専用のエラーハンドラが機能不足で、ハンドラがCallされる前にthreadがAbortする
Gmail Notifications : http://code.google.com/apis/talk/jep_extensions/gmail.html