My API call to github in the R-Studio console works just fine (httr package) but breaks whenever I attempt to knit a pdf. In the console I have to manually go to 'localhost:1410' when first authorizing my credentials but apparently this is unable to happen while knitting.
```{r}
oauth_endpoints("github")
myapp <- oauth_app("github", "xxxxxxxxxx")
github_token <- oauth2.0_token(oauth_endpoints("github"), myapp)
gtoken <- config(token = github_token)
req <- with_config(gtoken, GET("https://api.github.com/repos/mbostock/d3/stats/participation"))
stop_for_status(req)
result = content(req)
```
The error produced is
Error: oauth_listener() needs an interactive environment. Execution halted.
Any suggestions or workarounds?