You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using WaybackMachineCDXServerAPI.newest does not return the last snapshot, but some recent snapshot. For example for https://openlayers.org/, it returns a snapshot from 2022-06-16 17:20:36, the latest snapshot (as of today, September 10th 2022) is from 2022-09-10 08:05:37. There are around 380 snapshots between these two.
I've debugged this a bit and it seems there is an issue either with how sort or limit are configured, or interpreted by the CDX server. The method sets sort = 'closest' and limit = 1. If I configure the WaybackMachineCDXServerAPI instance manually and set to limit = -1 instead, then I actually get the latest snapshot. #155 (comment) hints that limit = -1 should be used for the latest snapshot.
To Reproduce
url='https://openlayers.org/'cdx_api=waybackpy.WaybackMachineCDXServerAPI(url)
newest_snapshot=cdx_api.newest()
print(newest_snapshot.datetime_timestamp)
# prints 2022-06-16 17:20:36, should be 2022-09-10 08:05:37
The CDX API docs are not super clear, but that looks like a bug. A workaround could be to use a higher limit for newest, and then only take the first result.
Describe the bug
Using
WaybackMachineCDXServerAPI.newest
does not return the last snapshot, but some recent snapshot. For example forhttps://openlayers.org/
, it returns a snapshot from2022-06-16 17:20:36
, the latest snapshot (as of today, September 10th 2022) is from2022-09-10 08:05:37
. There are around 380 snapshots between these two.I've debugged this a bit and it seems there is an issue either with how
sort
orlimit
are configured, or interpreted by the CDX server. The method setssort = 'closest'
andlimit = 1
. If I configure theWaybackMachineCDXServerAPI
instance manually and set tolimit = -1
instead, then I actually get the latest snapshot. #155 (comment) hints thatlimit = -1
should be used for the latest snapshot.To Reproduce
Workaround
Expected behavior
The newest API should return the newest snapshot.
Version:
The text was updated successfully, but these errors were encountered: