Skip to content

Instantly share code, notes, and snippets.

@soh335
Created January 19, 2010 04:22
Show Gist options
  • Save soh335/280667 to your computer and use it in GitHub Desktop.
Save soh335/280667 to your computer and use it in GitHub Desktop.
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