访问自己的照片时出现闪烁 Api 问题
Issue in Flicker Api when accessing own photos
我正在尝试通过此功能访问我自己的图片https://www.flickr.com/services/api/flickr.people.getPhotosOf.htm on a node package that I got from here https://www.npmjs.com/package/flickrapi\
如果我尝试访问任何其他用户的图片(例如,136485307@N06 - Apollo Image Gallery),我可以毫无问题地获取图片。但是,如果我尝试通过 user_id: "132868185@N07
或 user_id: "me"
访问我自己的照片,我将无法从服务中获得任何回报。我的代码现在看起来像这样:
var Flickr = require("flickrapi");
var FlickCred = require("./flickrAuthCred");
var flickrOptions = FlickCred;
Flickr.authenticate(flickrOptions, function(error, flick){
if(error){
console.log("Error!");
console.log(error);
return;
}
var photosReqOptions = {
user_id: "132868185@N07",
extras: ["owner_name", "date_taken", "date_upload", "path_alias"]
}
flick.people.getPhotosOf(photosReqOptions, function(error, data){
console.log(data.photos);
});
});
我觉得我错过了一步,但我无法确定是哪一步。任何建议都会有所帮助!
好的,我找到问题了。我试图使用错误的功能。即,我试图使用 flick.people.getPhotosOf
https://www.flickr.com/services/api/flickr.people.getPhotosOf.htm
当我应该使用flick.people.getPhotos
https://www.flickr.com/services/api/flickr.people.getPhotos.html
我正在尝试通过此功能访问我自己的图片https://www.flickr.com/services/api/flickr.people.getPhotosOf.htm on a node package that I got from here https://www.npmjs.com/package/flickrapi\
如果我尝试访问任何其他用户的图片(例如,136485307@N06 - Apollo Image Gallery),我可以毫无问题地获取图片。但是,如果我尝试通过 user_id: "132868185@N07
或 user_id: "me"
访问我自己的照片,我将无法从服务中获得任何回报。我的代码现在看起来像这样:
var Flickr = require("flickrapi");
var FlickCred = require("./flickrAuthCred");
var flickrOptions = FlickCred;
Flickr.authenticate(flickrOptions, function(error, flick){
if(error){
console.log("Error!");
console.log(error);
return;
}
var photosReqOptions = {
user_id: "132868185@N07",
extras: ["owner_name", "date_taken", "date_upload", "path_alias"]
}
flick.people.getPhotosOf(photosReqOptions, function(error, data){
console.log(data.photos);
});
});
我觉得我错过了一步,但我无法确定是哪一步。任何建议都会有所帮助!
好的,我找到问题了。我试图使用错误的功能。即,我试图使用 flick.people.getPhotosOf
https://www.flickr.com/services/api/flickr.people.getPhotosOf.htm
当我应该使用flick.people.getPhotos
https://www.flickr.com/services/api/flickr.people.getPhotos.html