Flickr API:获取访客通行证照片的信息?
因此,Flickr Guest Pass URL 采用以下格式:
www.flickr.com/x/t/[numericID]/gp/[userID]/[alphanumericID]
现在,如果我尝试以下形式的 API 调用:
API_KEY = 'myapikey'
PHOTO_ID = '[numericID]'
SECRET = '[alphanumericID]'
url = 'http://api.flickr.com/services/rest/?method=flickr.photos.getInfo' +
'&api_key=%s&photo_id=%s&secret=%s' % (API_KEY, PHOTO_ID, SECRET)
我确实得到了一些照片信息,但照片完全错误!
我的访客通行证中的照片 ID 以“00”开头可能与此相关:在 API 返回的信息中,最初的零已被截掉。
我是否向 getInfo() 提供了正确的信息?
So, Flickr Guest Pass URLs are in the following format:
www.flickr.com/x/t/[numericID]/gp/[userID]/[alphanumericID]
Now if I try an API call of the following form:
API_KEY = 'myapikey'
PHOTO_ID = '[numericID]'
SECRET = '[alphanumericID]'
url = 'http://api.flickr.com/services/rest/?method=flickr.photos.getInfo' +
'&api_key=%s&photo_id=%s&secret=%s' % (API_KEY, PHOTO_ID, SECRET)
I do get some photo information back, but for completely the wrong photograph!
It may be relevant that the photo ID in my Guest Pass starts "00": in the info returned by the API, the initial zeros have been chopped off.
Am I supplying the right information to getInfo()?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最后想通了。照片 ID 位于访客通行证解析为的 URL 中。秘密就在照片本身的 jpeg URL 中。
例如,对于照片:
照片 ID 是 URL 的最后部分。如果你查看照片,你会发现 URL 的 JPG 是
,从中你知道秘密是 f41c8d7fe7。
Figured it out in the end. The Photo ID is in the URL that the Guest Pass resolves to. The secret is in the URL of the jpeg of the photo itself.
So, for example, on a photo:
The photo ID is the final part of the URL. If you view the photo, you find that the JPG of the URL is
And from that, you know the secret is f41c8d7fe7.