1

我正在尝试使用 R 连接到 Instagram API,并希望我的代码在 Ubuntu 服务器上作为批处理运行。目前,当它需要连接到浏览器进行身份验证时,我正在使用oauth2.0_token并遇到错误。

当我尝试连接到服务器上的 API 时,我收到此消息

Waiting for authentication in browser...
Press Esc/Ctrl + C to abort

有什么办法可以解决这个问题?或者有没有更好的方法来连接 Instagram API?

这是我当前使用的产生错误的代码示例

app_name <- 'Testing'
client_id <- 'XXXXXXX'
client_secret <- 'XXXXXXX'
scope = 'basic'

instagram <- oauth_endpoint(
authorize = "https://api.instagram.com/oauth/authorize",
access = "https://api.instagram.com/oauth/access_token")
myapp <- oauth_app(app_name, client_id, client_secret)

ig_oauth <- ?oauth2.0_token(instagram, myapp,scope="basic",  
                       type = "application/x-www-form-urlencoded",cache=FALSE)
4

0 回答 0