Created
November 17, 2010 08:57
-
-
Save ericabouaf/703168 to your computer and use it in GitHub Desktop.
Check a Gmail account for move notifications from Dragon Go Server (DGS) and sends a Prowl notification to my iPhone
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
require 'rubygems' | |
require 'gmail' | |
require 'prowl' | |
gmail = Gmail.new('eric.****@gmail.com', '****') | |
emails = gmail.inbox.emails(:unread, :from => "noreply@dragongoserver.net") | |
if emails.size > 0 | |
email = emails.first | |
Prowl.add( | |
:apikey => '*****', | |
:application => "DGS", | |
:event => "New move", | |
:description => "A new DGS move is waiting !" | |
) | |
email.mark(:read) | |
email.archive! | |
end | |
gmail.logout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment