Hi There,
I am trying to send a shell command from R studio, using system2() comand, and when I try to do it from R, Twurl tells me to authenticate,
You must authorize first
even though from the command line, I can run the same command without any issues as I got authenticated earlier. My use case is to be able to schedule the ruby call from R, so that I would not have to run it manually.
Now the question is, can I pass in twurl command with authorization, for example referring twurlcr file?
Here is my code.
word <- “twurl”
args <- c("-H", “ads-api.twitter.com”, “/2/accounts/18ce54mzap4/promoted_tweets”)
here is my authorization command:
auth <- c(“authorize”, “–consumer-key”, “xxxxxxx”, “–consumer-secret”, “xxxxxxxxxx”)
It works but R Studio does not allow for user input in this example, so I cannot get properly authenticated, and cannot progress.
result <- system2(word, args, stderr = “TRUE”)
You must authorize first
authorize <- system2(word, auth, stderr = “TRUE”)
not possible since I cannot input my PIN.
Thanks,
gld_data_team