bare bones gmail notifier

Wed Oct 1 2008

This script checks your Gmail inbox for new messages every 2 minutes and beeps
if it finds any. It’s probably the most bare-bones of all the Gmail notifier programs
out there.

To use, just copy this script into a file on your local computer. You can name the file “gmail.rb”.

To run the program, set the variables at the top of the program. Then you can run the program by typing:

ruby gmail.rb

This assumes you have Ruby installed on your computer. It also assumes that you have enabled IMAP on your Gmail account. Finally, you
must also have installed the tmail gem, which you can install by typing

sudo gem install tmail

The program will check your Gmail inbox and download the headers for the 5 most recent messages. After that, it will check your inbox at intervals (default 2 minutes). If it sees any new messages, it will display their headers and issue a system beep.

Screenshot:

spartan ~/ruby: ruby gmail.rb 
time:    12:22 PM Wed Oct 01
from:    sophia@obfuscatedemail.com
subject: let's have coffee

time:    12:40 PM Wed Oct 01
from:    jenn@obfuscatedemail.com
subject: you're so cool

time:    12:40 PM Wed Oct 01
from:    colin@coolcolin.com
subject: i biked across america hear me roar

time:    12:43 PM Wed Oct 01
from:    aaron5@jazzykat.com
subject: i love python

time:    12:48 PM Wed Oct 01
from:    zmarstall@obfuscatedemail.com
subject: ruby rocks

To stop the program, press Control-C.

back to top

a tweaked version of the micro theme by seaofclouds, and powered by YAML, Textile, and this simple, home-grown ruby build script.