Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

get username and password from .netrc

  • Loading branch information...
commit cb5c07f0bab3e84d0d65537fdbaf8209cedc5e85 1 parent db15b87
Andrew Jones authored

Showing 1 changed file with 7 additions and 3 deletions. Show diff stats Hide diff stats

  1. +7 3 lib/App/gcal.pm
10 lib/App/gcal.pm
@@ -64,10 +64,14 @@ sub _save_to_gcal {
64 64 my ($cal) = @_;
65 65
66 66 unless ($gcal) {
67   - $gcal = Net::Google::Calendar->new;
68 67
69   - # TODO: load from .netrc, or similar
70   - $gcal->login( '', '' );
  68 + # get login and password from .netrc
  69 + require Net::Netrc;
  70 + my $netrc = Net::Netrc->lookup('google.com');
  71 +
  72 + # login
  73 + $gcal = Net::Google::Calendar->new;
  74 + $gcal->login( $netrc->login, $netrc->password );
71 75 }
72 76
73 77 for my $entry ( @{ $cal->entries } ) {

0 comments on commit cb5c07f

Please sign in to comment.
Something went wrong with that request. Please try again.