Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

get username and password from .netrc

  • Loading branch information...
commit cb5c07f0bab3e84d0d65537fdbaf8209cedc5e85 1 parent db15b87
@andrewrjones authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/App/gcal.pm
View
10 lib/App/gcal.pm
@@ -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 } ) {
Please sign in to comment.
Something went wrong with that request. Please try again.