2

I would like to use httr to link up/upload my R image outputs to flickr, but am having difficulty with the initial stages where i need to authenticate myself using OAuth 1.0.

I previously created an app by going to the following link http://www.flickr.com/services/apps/create/apply/

and then got a secret and key string for that app...

I then used it in the httr package function to get a token but to no avail. I have been trying to use the provided documentation on this link http://www.flickr.com/services/api/auth.oauth.html to help out but, I am struggling...

The following is the code I used.

flickr.app <- oauth_app("flickr",key="xxxxxx", secret="xxxxxxxx")
flickr.urls <- oauth_endpoint(request="http://www.flickr.com/services/oauth/request_token",
                              authorize="http://www.flickr.com/services/oauth/authorize",
                              access="http://www.flickr.com/services/oauth/access_token")
flickr.token <- oauth1.0_token(flickr.urls,flickr.app)

from which i get the error message

Error: http client error (400)

Not too sure where to go from here...any help would be much appreciated.

N.B. Also I recognise that due to the nature of setting up api links, that there are secrets , api-keys, logins and passwords that need to be kept secret etc, but it does not take long to set up a dummy flickr account from www.flickr.com , to be able to reproduce the problem...in my opinion...perhaps others could try setting one up and letting me know if they got similar issues, and potential methods to work around the situation?

4

1 回答 1

2

我从未使用过 httr 库,但我最近(截至昨天)刚刚从头开始编写 Objective-C 代码以访问 Flickr。对我来说最大的痛点是弄清楚如何正确编码签名。我不太了解 httr 库,但如果我不得不猜测我的猜测是它没有正确编码签名。

如果您阅读此内容: http: //www.flickr.com/services/api/auth.oauth.html

您将找到有关如何使用 Flickr 进行授权的非常详细的说明——这对我很有用,因为我从头开始用 Objective C 编写代码。除非您能够通过 httr 源进行调试并确定它是否完全按照 Flickr 的预期做事,否则可能对您没那么有用。

于 2012-10-29T11:34:11.710 回答