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
Wayback Mementos carry additional info about related resources in the Link header. For example, here’s the header from https://web.archive.org/web/20171124151315id_/https://www.fws.gov/birds/:
It would probably be nice to surface this information in the Memento class in some useful way. We originally planned to do this in #2, but it wasn’t critical and there were enough open questions and options that it seemed worth waiting on coming up with a better design for.
Some possibilities:
Simply parse the data generically, like the Requests package does:
Another thing to consider is that we don’t currently have any special support for timemaps or timegates, so we can’t do anything special for those links. Basic dict parsing would probably be the lowest common denominator here. It’s not very special, but lets us treat everything the same.
Lots of ways we could go here. ¯\_(ツ)_/¯
The text was updated successfully, but these errors were encountered:
This fixes an issue where the `Memento.url` property could be slightly incorrect, since it was based on the URL you requested the memento from (e.g. `https://web.archive.org/web/20221010000000/<url>`), rather than the actual URL the memento was captured from. The URL the memento is requested from matches records via SURT key rather than the URL.
For example, requesting an archived copy of `http://fws.gov/` might return a capture of `https://www.fws.gov/` instead. The returned Memento object’s `url` property used to be `http://fws.gov/` in this case, but this changes it to be `https://www.fws.gov/`.
Since this required checking the `links` header, I also went ahead and made the parsed `links` data available on `Memento`.
Fixes#57.
Fixes#99.
Wayback Mementos carry additional info about related resources in the
Link
header. For example, here’s the header fromhttps://web.archive.org/web/20171124151315id_/https://www.fws.gov/birds/
:(Line breaks added for clarity.)
This follows the standard format for the
Link
header. The most accessible docs are at MDN.It would probably be nice to surface this information in the
Memento
class in some useful way. We originally planned to do this in #2, but it wasn’t critical and there were enough open questions and options that it seemed worth waiting on coming up with a better design for.Some possibilities:
Simply parse the data generically, like the Requests package does:
Since the
original
andmemento
relationships are redundant (all that info is already onMemento
), we could drop them.We could make these a more special type than a dict so they can be passed to
get_memento()
, e.g:We could add
get_next_memento()
, etc. as a shortcut toget_memento()
, e.g:Since these are known, predictable links, we could add attributes directly to
Memento
instead ofMemento.links
:Another thing to consider is that we don’t currently have any special support for timemaps or timegates, so we can’t do anything special for those links. Basic
dict
parsing would probably be the lowest common denominator here. It’s not very special, but lets us treat everything the same.Lots of ways we could go here. ¯\_(ツ)_/¯
The text was updated successfully, but these errors were encountered: