strsplit error when attempting to access Fitbit with ROAuth

社会主义新天地 提交于 2019-12-25 16:42:06

问题


I am attempting to access the fitbit API using ROAuth but keep falling at the first hurdle.

Here is my code:

library(ROAuth)

reqURL <- "https://api.fitbit.com/oauth/request_token"
accessURL <- "https://api.fitbit.com/oauth/access_token"
authURL <- "https://www.fitbit.com/oauth/authorize"
cKey <- "xxxxx"
cSecret <- "xxxxx"

credentials <- OAuthFactory$new(consumerKey=cKey,
                            consumerSecret=cSecret,
                            requestURL=reqURL,
                            accessURL=accessURL,
                            authURL=authURL)
credentials$handshake()

Running this gives the following rather cryptic error:

Error in strsplit(response, "&") : non-character argument

Any suggestions, greatly appreciated!


回答1:


Following the suggestion of @hadley rather than solving the ROAuth problem, I have switched to using the httr package instead. The code in this question worked for me.



来源:https://stackoverflow.com/questions/16882011/strsplit-error-when-attempting-to-access-fitbit-with-roauth

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!