Guest
Public paste!

Untitled

By: a guest | Mar 20th, 2010 | Syntax: JavaScript | Size: 1.60 KB | Hits: 45 | Expires: Never
Copy text to clipboard
  1. // ==UserScript==
  2. // @name           lol
  3. // @include        http://www.lgc-family.com/forum/newreply.php?do=postreply&t=12863*
  4. // @include        http://www.lgc-family.com/forum/showthread.php?t=12863*
  5. // ==/UserScript==
  6. var msg = Math.floor(Math.random()*100000000);
  7.  
  8. if(document.URL.match("showthread.php"))
  9. {
  10.         postReply();
  11. }
  12.  
  13. function postReply()
  14. {
  15.         get("http://www.lgc-family.com/forum/showthread.php?t=12863", function(r){
  16.                 turing = FindText(r,'name="securitytoken" value="','"');
  17.                 p = "wysiwyg=vB_Editor_001_mode&s=&securitytoken=" + turing + "&do=postreply&t=12863&p=&specifiedpost=0&posthash=46241619198ed644229ee2f58e8237c2&poststarttime=1261592090&loggedinuser=383&multiquoteempty=&message=hey+seneca+whats+up+bro+" + msg;
  18.                         post("http://www.lgc-family.com/forum/newreply.php",p,function(html){
  19.                                 //alert(p);
  20.                                 setTimeout(refresh, 22000);
  21.                         })
  22.         })
  23. }
  24.  
  25. function refresh()
  26. {
  27.                 window.location.href = "/forum/showthread.php?t=12863";
  28. }
  29.  
  30. function post(url,data,cb){
  31.    GM_xmlhttpRequest({
  32.     method: "POST",
  33.     url: url,
  34.     headers:{'Content-type':'application/x-www-form-urlencoded'},
  35.     data:encodeURI(data),
  36.     onload: function(xhr) { cb(xhr.responseText); }
  37.   });
  38. }
  39.  
  40.  
  41. function get(url, cb) {
  42.   GM_xmlhttpRequest({
  43.     method: "GET",
  44.      url: url,
  45.      onload: function(xhr) {
  46.         cb(xhr.responseText);    
  47.          }
  48.   });
  49. }
  50.  
  51.  
  52. function FindText(str, str1, str2)
  53. {
  54.   var pos1 = str.indexOf(str1);
  55.   if (pos1 == -1) return '';
  56.  
  57.   pos1 += str1.length;
  58.  
  59.   var pos2 = str.indexOf(str2, pos1);
  60.   if (pos2 == -1) return '';
  61.  
  62.   return str.substring(pos1, pos2);
  63. }