Created
January 19, 2010 04:22
-
-
Save soh335/280667 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
use strict; | |
use warnings; | |
use WebService::Google::Reader; | |
use Net::Growl; | |
use Getopt::Long; | |
use FindBin; | |
use YAML::Tiny; | |
use Data::Dumper; | |
$XML::Atom::ForceUnicode = 1; | |
my $AppName = "GoogleReader Growler"; | |
my $path = File::Spec->catfile($FindBin::Bin, 'config.yaml'); | |
GetOptions('--config=s', \$path); | |
my $config = get_preferences($path); | |
Net::Growl::register( | |
host => 'localhost', | |
application => $AppName, | |
password => $config->{growl}->{password}, | |
); | |
my $reader = WebService::Google::Reader->new( | |
username => $config->{google}->{username}, | |
password => $config->{google}->{password}, | |
); | |
foreach my $entry ($reader->unread(count => 10)->entries) { | |
Net::Growl::notify( | |
application => $AppName, | |
title => $entry->title, | |
description => $entry->content->body, | |
password => $config->{growl}->{password}, | |
); | |
} | |
sub get_preferences { | |
YAML::Tiny::LoadFile(shift); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment