Skip to content

Commit

Permalink
use Mac::Growl to display notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Masayoshi Sekimura committed Jul 24, 2009
1 parent 36cc40f commit 57ce56b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion example/gmail-notifier
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package GmailNotifier;
use Moose;
use AnyEvent;
use AnyEvent::Gmail::Feed;
use Mac::Growl ':all';

with 'MooseX::Getopt';

Expand All @@ -14,14 +15,15 @@ sub run {
my ($self, %args) = @_;

my %seen;
RegisterNotifications('GmailNotifier', ['email.arrived'], ['email.arrived']);
AnyEvent::Gmail::Feed->new(
username => $self->username,
password => $self->password,
interval => $self->interval,
on_new_entry => sub {
my $entry = shift;
## you can send notify with Growl, Notify-OSD or whatever
warn "send notify: " . $entry->summary;
PostNotification('GmailNotifier', 'email.arrived', $entry->title, $entry->summary);
},
);
AnyEvent->condvar->recv;
Expand Down

0 comments on commit 57ce56b

Please sign in to comment.