Share
geosmina_ 11:11pm, 15 August 2021
I mean, if I select, let´s say, 01 of august, 2011, I will get a list of the photos taken in just that day, no more, no less. Just that day from the first to the last minute.

I´m using React for this, tho dunno if it matters. I know I need to play with the max_taken_date=${max-unix-number}&min_taken_date=${min-unix-number}.

I was thinking of trying to "rest" the value from the max-unix-number to get the min one, but dunno if there are better ways to achieve this.
Xenedis 3 months ago
geosmina_:
I mean, if I select, let´s say, 01 of august, 2011, I will get a list of the photos taken in just that day, no more, no less. Just that day from the first to the last minute.

The approach I considered was to use flickr.photos.search and specify the 'min_taken_date' as 2021-08-01 00:00:00 and the 'max_taken_date' as 2021-08-01 23:59:59, but when I tried it, oddly, the API also returned images taken on 2021-08-02.
geosmina_ 3 months ago
Ok I think I got something working decently. The main function I´m using is this one:

function toMaxTakenDate(timeStamp){
let dia = 86399
console.log('toMaxTakenDate'+timeStamp + dia)
return timeStamp + dia
}

basically sums up the day from 00:00 hours to 59:59 and works.
Xenedis 3 months ago
I am not familiar with the language you are using, but as I see it, there are two issues to consider.

The first issue is how you generate the minimum and maximum dates. There are probably several ways of doing so.

The second issue is dealing with what the API returns, and I found that it returned images outside the date range I specified.

If that happens to you, you will need to apply some logic to skip any dates outside your specific date range.
geosmina_ 3 months ago
with the code I´m using I get a correct range (from the conosole.log):

1minTakenDate: 02-04-2010 00:00:00, maxTakenDate: 02-04-2010 23:59:591
Xenedis 3 months ago
geosmina_:
with the code I´m using I get a correct range (from the conosole.log):

1minTakenDate: 02-04-2010 00:00:00, maxTakenDate: 02-04-2010 23:59:591

That date format is not valid for flickr.photos.search.

It needs formatted as either MySQL datetime or a UNIX timestamp.

The date would need to be represented as YYYY-MM-DD, not DD-MM-YYYY or MM-DD-YYYY.
geosmina_ 3 months ago
yeah I know. I´m converting everything to UNIX timestamp when fetching stuff.
Xenedis 3 months ago
geosmina_:
I´m converting everything to UNIX timestamp when fetching stuff.


I did not try using a UNIX timestamp when testing with the API; but I wonder whether the API returns dates outside the range when using a UNIX timestamp rather than a MySQL datetime.
Groups Beta