node-flickrapi icon indicating copy to clipboard operation
node-flickrapi copied to clipboard

No results when using min/max_taken_date

Open fitsum opened this issue 8 years ago • 7 comments

I get results here only if the min_taken_date and max_taken_date are commented out

var Flickr = require("flickrapi"),    
        flickrOptions = {    
                      api_key: "xxxxxxxxxxxxxxxxxxxxx",    
                      secret: "xxxxxxxxxxxxxxxxxxxxx"    
                                        };        
Flickr.authenticate(flickrOptions, function(error, flickr) {    
        if(error){return console.error(error);}    
        flickr.photos.search({    
          user_id: "xxxxxxxxxxxxxxxxxxxxx",    
          min_taken_date: "2011-01-16+00:00:00",    
          max_taken_date: "2011-01-17+00:00:00"    
        }, function(err, result) {                                                                                                          
                if(err){throw new Error(err);}    
              console.log(result.photos);                                                                                                   
           });                                                                                                                                                   
}); 

fitsum avatar Apr 28 '16 02:04 fitsum

hm. marking as bug, will try to have a look at this soon. thanks for reporting it!

Pomax avatar Apr 28 '16 18:04 Pomax

do you have ETA for resolution or can you suggest a package that's as good that I could use in the meantime? thanks.

fitsum avatar May 07 '16 22:05 fitsum

I do not, but I am taking a two week break from my day job so this is a thing I'll actually have time to look at. As for alternatives: the only reason I wrote this package was because there were none. Maybe that has changed since, but I don't know of any.

If you want to do some bug hunting to help expedite the process, though, it might be worth putting a few console logs in https://github.com/Pomax/node-flickrapi/blob/master/src/utils.js#L259-L326 and seeing what's getting sent to Flickr, and what kind of error(s) it reports as a consequence.

Pomax avatar May 09 '16 05:05 Pomax

cool, will do that this week. thanks

fitsum avatar May 09 '16 06:05 fitsum

follow-up thought: the API claims "The date can be in the form of a mysql datetime or unix timestamp", so if things don't work with the former, it's worth checking if things do work with the latter.

Pomax avatar May 09 '16 17:05 Pomax

Adding force_auth=true to flickrOptions fixed this issue for me; previously (13 months ago and version 0.3.36 when I last used) querying my photos by a min_date_taken and max_date_taken range had worked without needing to do this.

kbruland avatar Mar 11 '17 17:03 kbruland

I have no idea why that would work, supposedly auth is not required for those two optional arguments.

Pomax avatar Mar 11 '17 17:03 Pomax