Skip to content

Instantly share code, notes, and snippets.

@ericabouaf
Created November 17, 2010 08:57
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 ericabouaf/703168 to your computer and use it in GitHub Desktop.
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
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