summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2015-11-13 21:16:58 +0000
committerdakkar <dakkar@thenautilus.net>2015-11-13 21:16:58 +0000
commitbb2e450bace30f2e9b40dbd038b172484073530e (patch)
treef4d32b5b2cddb6254c55106756f266acad6742e0
parentscript for oauth token (diff)
downloadgoogle-to-text-bb2e450bace30f2e9b40dbd038b172484073530e.tar.gz
google-to-text-bb2e450bace30f2e9b40dbd038b172484073530e.tar.bz2
google-to-text-bb2e450bace30f2e9b40dbd038b172484073530e.zip
working get-token
-rw-r--r--get-oauth2-token8
1 files changed, 5 insertions, 3 deletions
diff --git a/get-oauth2-token b/get-oauth2-token
index 749863c..5db32d3 100644
--- a/get-oauth2-token
+++ b/get-oauth2-token
@@ -15,7 +15,9 @@ my $oauth2 = Net::Google::DataAPI::Auth::OAuth2->new(
scope => ['https://www.googleapis.com/auth/calendar.readonly'],
);
my $url = $oauth2->authorize_url();
-my $code = prompt('x', "Go to $url, then paste the code: ", '', '');
+say "Go to:";
+say $url;
+my $code = prompt('x', "then paste the code: ", '', '');
my $token = $oauth2->get_access_token($code) or die;
-$config{oauth2}->{token}=$token;
-$config_file->save('google-to-text.conf',\%config);
+$config{oauth2}->{token}=$token->session_freeze;
+$config_file->save_file('google-to-text.conf',\%config);