Hello,
It sounds like you are hitting the 1000 key limit on AWS:
IDL> u=idlneturl()
IDL> out=u.get(url=url,/buffer,/string)
IDL> print,stregex(out,'<IsTruncated>[[:alpha:]]+</IsTruncated>',/extract)
<IsTruncated>true</IsTruncated>
The list is separated into pages, each with a maximum of 1000 keys. So, one approach is to use the marker parameter to get the next page of up to 1000 keys, and repeat until you get to the end (when IsTruncated becomes false):
This is not the neatest code, but it does the job of retrieving all keys:
u=idlneturl()
page=0L
lastkeys=list()
firstkeys=list()
lastkey=''
repeat begin
url=baseurl+'/?marker='+lastkey
print,'retrieving page ',strtrim(page,2)
out=u.get(url=url,/buffer,/string)
istruncated=(stregex(out[1],'<IsTruncated>([[:alpha:]]+)</IsTruncated>',/subexpr,/extract))[-1]
outs='<'+strsplit(out[1],'<',/extract)
keys=outs[where(stregex(outs,'<Key>.+',/boolean))]
keys=reform((stregex(keys,'<Key>(.*)',/extract,/subexpr))[1,*])
lastkey=keys[-1]
page+=1
lastkeys.add,lastkey
firstkeys.add,keys[0]
print,'first key: ',keys[0]
print,'last key: ',lastkey
endrep until istruncated eq 'false'
print,'Found ',strtrim(page,2),' pages'
print,'Last key: ',lastkeys[-1]
I just ran it, and for that particular list it is not really practical to get to end of the list. It starts with 1991/06/05/KTLX/KTLX19910605_162126.gz, and, after 1000 pages, only gets to 1995/04/09/KMLB/KMLB19950409_230634.gz. It will take a long time (days, I guess) to get to the end in 2018.
Since you only want the most recent one, you could save time by using the prefix parameter, to filter the list to keys starting with that prefix. If I set a prefix of 2018/03/, I get 470 pages just for these 16 days in March/2018. You could set a prefix of yesterday's date, and look for the last one (yesterday instead of today, to avoid problems with timezones). A prefix can be added by changing the url, as in
url=baseurl+'/?prefix=2018/03/&marker='+lastkey
Paulo