Advertisement
Guest User

Untitled

a guest
Aug 6th, 2016
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        Amiami 200 items
  3. // @namespace   anon
  4. // @version     1.0.2
  5. // @run-at      document-start
  6. // @include     http://*.amiami.com*
  7. // @description This script changes all links from loading 40 items per page to 200 in amiami
  8. // ==/UserScript==
  9.  
  10. var amisearch  = window.location.search;
  11.  
  12. if ( /\pagemax=40$/.test(amisearch) ) {
  13.  
  14. var newsearch = amisearch.replace('&pagemax=40','&pagemax=200');
  15.  
  16.     var newURL  = window.location.protocol + "//"
  17.                 + window.location.host
  18.                 + window.location.pathname
  19.                 + newsearch
  20.                 + window.location.hash;
  21.  
  22.     window.location.replace(newURL);
  23.  
  24. }
  25.  
  26. document.addEventListener ("DOMContentLoaded", DOM_ContentReady);
  27. window.addEventListener ("load", pageFullyLoaded);
  28.  
  29. function DOM_ContentReady () {
  30.  
  31. var links,thisLink;
  32. links = document.evaluate("//a[@href]",
  33.     document,
  34.     null,
  35.     XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
  36.     null);
  37. for (var i=0;i<links.snapshotLength;i++) {
  38.     var thisLink = links.snapshotItem(i);
  39.  
  40.     thisLink.href = thisLink.href.replace('&pagemax=40','&pagemax=200');
  41. }
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement