Voat Archive

Mirror links on archive.is for Voat submission links

  1. // ==UserScript==
  2. // @name Voat Archive
  3. // @description Mirror links on archive.is for Voat submission links
  4. // @namespace https://voat.co/user/InsistentCooperative
  5. // @match *://*.voat.co/*
  6. // @version 1.1
  7. // @grant none
  8. // @license MIT
  9. // @license WTFPL
  10. // @license Public Domain
  11. // ==/UserScript==
  12.  
  13. for (let hold of document.querySelectorAll('.submission:not(.self) a.title[href]:not([href*="://archive.is/"]) ~ .domain')) {
  14. let orig = hold.parentNode.querySelector('a.title');
  15. let href = 'https://archive.is/?run=1&url=' + encodeURIComponent(orig.href); // from their bookmarklet
  16. hold.innerHTML += ' <span class="_gm_voat_archive">[<a href="' + href + '" class="_gm_voat_archive">archive</a>]</span>';
  17. }