CodeCodeCode

get

Apr 27th, 2012
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name           GET
  3. // @namespace      HERPDERP
  4. // @include        http://boards.4chan.org/*
  5. // ==/UserScript==
  6. /*
  7.  * Edited version of: http://userscripts.org/scripts/show/101413
  8.  * Allows Posting of your own comments.
  9.  *
  10.  * Instructions:
  11.  * 1) Fill out captcha and comment
  12.  * 2) Paste number you want in password field
  13.  * 3) Double click the password field
  14.  * 4) Wait for it to post
  15.  * 5) Adjust "var s" as needed to time it right. The higher the number, the earlier the post.
  16.  *
  17.  * Note: Only works on normal post field, no quick reply.
  18. */
  19. var first = true, n = 1;
  20. var s = 2;
  21. document.getElementsByName("pwd")[0].type = "text";
  22. function check() {
  23.     if (n == 0) return;
  24.     var k = first ? n : (n-s);
  25.     GM_xmlhttpRequest({
  26.         method: "HEAD",
  27.         url: "http://sys.4chan.org" + location.pathname.match(/\/[^\/]+\//)[0] + "imgboard.php?res=" + k,
  28.         onload: function(response) {
  29.             if (n == 0) return;
  30.             if (response.status == 200) {
  31.                 if (first) {
  32.                     alert(n + " passed");
  33.                     n = 0;
  34.                 } else {
  35.                     document.getElementsByName("post")[0].submit();
  36.                 }
  37.             } else {
  38.                 first = false;
  39.                 check();
  40.             }
  41.         }
  42.     });
  43. }
  44. document.getElementsByName("pwd")[0].addEventListener("dblclick", function(e) {
  45.         first = true;
  46.         n = parseInt(document.getElementsByName("pwd")[0].value);
  47.         document.getElementsByName("pwd")[0].value = "Posting..."
  48.         check();
  49. }, false);
Advertisement
Add Comment
Please, Sign In to add comment