artemklevtsov / RGA

A Google Analytics API client for R
http://cran.r-project.org/package=RGA
32 stars 13 forks source link

Error in BASH : oauth_listener() needs an interactive environment #50

Closed AgnieszkaTomczyk closed 7 years ago

AgnieszkaTomczyk commented 7 years ago

Hi @artemklevtsov :) :) I'm trying to run some Rscript via cron job. The error I get in terminal is:

Access token will be stored in the './ga-token.rds' file. Error: oauth_listener() needs an interactive environment. Execution halted

My code is:

library(RGA)
authorize(client.id = ".......", client.secret = ".......", cache = "./ga-token.rds")`

Do you know what is wrong? Thx, Agnieszka

artemklevtsov commented 7 years ago

Hi @AgnieszkaTomczyk.

You should athuhorize the RGA app in interactive mode and store obtained credentials (cached by default). Then you can use a cached token in the non-interactive mode.

AgnieszkaTomczyk commented 7 years ago

Hi @artemklevtsov Thanks a lot. Would you be so kind and give me some more detailed instruction? I am a beginner in this field...

artemklevtsov commented 7 years ago

First look at #20.

AgnieszkaTomczyk commented 7 years ago

All right. Thanks a lot. A have just fixed it :)