PTH Random album

Load a random album

  1. // ==UserScript==
  2. // @name PTH Random album
  3. // @version 0.2
  4. // @description Load a random album
  5. // @author Chameleon
  6. // @include http*://redacted.ch/torrents.php?id=*
  7. // @grant none
  8. // @namespace https://greasyfork.org/users/87476
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. var linkbox=document.getElementsByClassName('linkbox')[0];
  15. var a=document.createElement('a');
  16. linkbox.appendChild(a);
  17. a.innerHTML = 'Random album';
  18. a.setAttribute('class', 'brackets');
  19. a.href='/torrents.php?id='+Math.round(Math.random()*265246);
  20. })();