Permalink
Browse files

get username and password from .netrc

  • Loading branch information...
1 parent db15b87 commit cb5c07f0bab3e84d0d65537fdbaf8209cedc5e85 @andrewrjones committed Nov 11, 2011
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/App/gcal.pm
View
@@ -64,10 +64,14 @@ sub _save_to_gcal {
my ($cal) = @_;
unless ($gcal) {
- $gcal = Net::Google::Calendar->new;
- # TODO: load from .netrc, or similar
- $gcal->login( '', '' );
+ # get login and password from .netrc
+ require Net::Netrc;
+ my $netrc = Net::Netrc->lookup('google.com');
+
+ # login
+ $gcal = Net::Google::Calendar->new;
+ $gcal->login( $netrc->login, $netrc->password );
}
for my $entry ( @{ $cal->entries } ) {

0 comments on commit cb5c07f

Please sign in to comment.