3

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

  • 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 Jul 28 at 17:41
2

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.

  • 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 Aug 5 at 19:44

You must log in to answer this question.

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