7

Screenshot / demo

archive button in post menu

demonstration GIF

About

Inspired by the Meta Stack Exchange question Automatically have links archived in the Wayback Machine. This script searches the post for external links and offers a simple way to archive them in the Wayback Machine, so that future readers will be able to access any additional information (context for quotes, recommended reading, etc.) even though the links may break.

Installation

developed & tested with Violentmonkey on Firefox

Notes

You can hover over the link to see what will be archived; if none are found, the link will be grayed out:

archive button disabled

1
  • 1
    A future version might check whether the pages are already archived via the Wayback Machine API and let you decide (based on the age of the snapshot and/or differences in content) whether a link should be archived or not.
    – Glorfindel
    Commented Jul 28, 2019 at 17:41

1 Answer 1

3

I've got a couple suggestions for improvements, based on my use of the script.

First, deal with duplicate links. If I've linked to the same source twelve times, there's no need to archive that link twelve times. The script should grab each unique link from the post before trying to archive them.

Secondly, don't try to archive every link at once. If you're archiving the sources of a post, odds are that the post'll be relatively well-sourced and thus have a significant number of links. For instance, my answer Was the mythology in "Moana" based on an established myth? has a total of 86 links, according to the script (a large number of which are duplicate links, though).
So when I tried to archive the sources, the script immediately opened up 86 tabs at once and nearly gave my computer a heart attack.
I'd suggest doing this in batches - for instance, first grab all the links from the post. Filter out duplicate links. Then, with the last you have then, grab the first five links or so, and then archive them. Wait ~5 seconds, at least. Then do the next batch of five links. Etcetera.

1
  • Thank you for the suggestions. I've just released v0.2 of the script, which detects duplicate links (your example answer now contains 33 unique links), and archives the links in the background - the archive button becomes a progress indicator.
    – Glorfindel
    Commented Aug 5, 2019 at 19:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .