SauceNAO Moder

Easy to Use SauceNAO

  1. // ==UserScript==
  2. // @name SauceNAO Moder
  3. // @description Easy to Use SauceNAO
  4. // @version 1.0.1702056
  5. // @author DanoR
  6. // @namespace http://weibo.com/zheung
  7. // @grant none
  8. // @include *://saucenao.com/*
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. const qsa = function(selector) {
  13. const result = [], arr = document.querySelectorAll(selector);
  14.  
  15. for(let i = 0; i < arr.length; i++) result.push(arr[i]);
  16. return result;
  17. };
  18.  
  19. setTimeout(function() {
  20. window.togglenao();
  21.  
  22. const as = qsa('div.resultcontentcolumn>a');
  23.  
  24. for(const i in as) {
  25. const a = as[i];
  26.  
  27. a.target = '_blank';
  28.  
  29. if(a.innerHTML.indexOf('hentai-foundry') + 1) {
  30. const r = a.href.match(/com\/\w\/(.*?\/\d+?)\//);
  31.  
  32. if(r)
  33. a.href = 'http://www.hentai-foundry.com/pictures/user/' + r[1];
  34.  
  35. a.innerHTML = 'hentai-foundry.com';
  36. }
  37. }
  38. }, 2014);
  39. })();