Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
XCRail(TM) MediaWiki Auto Spammer 2.5
/*小曹铁路自动维基广告器
XCRail(TM) MediaWiki Auto Spammer 2.3
Powered by XCRail 2016.10.9
支持所有MediaWiki站点
版权所有:2016 小曹铁路/小曹2015/萌萌哒的小曹大大 保留所有权利
编程语言:JavaScript
使用方法:放到阁下用户页的common.js中并点击“显示预览”(不要保存)
如果阁下使用Chrome浏览器,也可以按F12->Console,粘贴代码,回车即开始执行。
如果代码执行到获得token后没反应,请粘贴两次/重新执行一遍。
如果不会用,请加群221312284获得更新和技术支持。
更新日志请参阅代码最后*/
var time1 = new Date().getTime()//计时系统
var sitename = "/commons/rbqwiki"//接入点URL中的api.php位置,不含"/api.php"。
var lmd = 15//傀儡系统的灵敏度,默认15。建议不要小于10
var pgs = 2000//页面数量,建议与{{NUMBEROFPAGES}}相等,默认2000
var abusecross = false//是否使用通假字尝试绕过滥用过滤器,true为是,false为否
var vandalismingcode = "小曹铁路,世界上最好的铁路组织。快加入小曹铁路群。曹铁粉丝千千万。小曹铁路默秒全,小曹铁路平天下。小曹铁路好加群 221312284 。"//广告文字
var mode = 1//广告模式
/* 模式1:创建广告页面
模式2:随机页面插入广告内容*/
var delay = 1000//每次发广告的延迟时间(单位:毫秒*3),默认1100
var pagenameusestring = true//使用字符串作为创建广告页面的名字。在mode=1时有效。
var thread = 1//并发编辑数,视网速而定,越大速度越快。建议不大于3,默认1。
//请勿修改以下部分,除非阁下了解您在做什么
//绕过滥用过滤器、防和谐代码开始
var vandalisming = vandalismingcode
var firstedit = 0
refreshvandalism();
function refreshvandalism()
{
vandalisming = vandalismingcode
print("正在生成广告文字->");
for(var i=0;i<=10;i++){
if (abusecross == true)
{
vandalisming = hexieStr(vandalisming,["晓","暁","晓","xiǎo","小"],"小");
vandalisming = hexieStr(vandalisming,["曹","艹","草","cao","槽"],"曹");
vandalisming = hexieStr(vandalisming,["铁","鉄","鐵","鐡","tie"],"铁");
vandalisming = hexieStr(vandalisming,["露","录","足各","陆","鹿","路"],"路");
vandalisming = hexieStr(vandalisming,["2","二","贰","②","2"],"2");
vandalisming = hexieStr(vandalisming,["1","一","壹","①","幺","Ⅰ"],"1");
vandalisming = hexieStr(vandalisming,["三","3","叁","③","3"],"3");
vandalisming = hexieStr(vandalisming,["摸","墨","莫","默","mo","末","陌","膜","沫"],"默");
vandalisming = hexieStr(vandalisming,["天","填","添"],"天");
vandalisming = hexieStr(vandalisming,["平","坪","瓶","凭","评","萍","甁","屛","ping"],"平");
vandalisming = hexieStr(vandalisming,["全","权","拳","quan","權","権","泉","荃","铨","痊"],"全");
vandalisming = hexieStr(vandalisming,["裙","群","qun"],"群");
vandalisming = hexieStr(vandalisming,["粉","份","fen"],"粉");
vandalisming = hexieStr(vandalisming,["千","签","牵","倩","迁"],"千");
}
}
print("生成的广告文字:"+vandalisming);
}
function hexieStr(str,replacing,replacer)
{
console.log(replacer);
console.log(replacing);
console.log(str);
var replacing2 = replacing[Math.floor(Math.random()*str.length)];
var rd = Math.floor(Math.random()*15)
console.log(rd);
if(replacing[rd] == undefined){
for(var i=0;i=-1;i++){
if(replacing[rd] != undefined){
break;
}
else{
var rd = Math.floor(Math.random()*15)
console.log(rd);
}
}
}
console.log(replacing[rd]);
replacing2 = replacing[rd]
console.log("1"+replacer);
console.log(replacing2);
str=str.replace(replacer,replacing2);
return str
}
//检测404
var pic_url =sitename+"/api.php"
$.ajax({
url:pic_url,
error:function(xhr, error, ex){
if (xhr.status == '404') {
print("<span style='color:red;'>失败:网络连接失败,请重试。如问题仍继续,请将sitename定位至网站的api.php位置。</span>");
throw("404 Error");
}
},
success:function(){
pic_url = pic_url;
}
});
//编辑部分
var aw1
var times = 0
var token='+/'
gettoken();
function gettoken()
{
try{
$.post(sitename+'/api.php?action=query&meta=tokens&format=json',"",function (text, status) { xcrailgettoken(text); });
}
catch(e)
{
print("<span style='color:red;'>失败:网络连接失败,请重试。如问题仍继续,请将sitename定位至网站的api.php位置。</span>");
}
}
function xcrailgettoken(text) {
var obj = eval(text);
print("正在获取token代码->");
try{
print("已获取token代码:"+obj.query.tokens.csrftoken);
}
catch(e)
{
print("<span style='color:red;'>失败:网络连接失败,请重试。如问题仍继续,请将sitename定位至网站的api.php位置。</span>");
}
var xcrail=obj.query.tokens.csrftoken
for(var i=0;i<=thread;i++){
var pid=Math.floor(Math.random()*pgs)
if(mode == 2)
{
$.post(sitename+'/api.php?action=edit&format=json&pageid='+pid+'&text='+vandalisming,'token='+encodeURIComponent(xcrail), function (text, status) { aw1 = eval(text); });
}
else if(mode == 1)
{
if(pagenameusestring == true)
{
$.post(sitename+'/api.php?action=edit&format=json&title='+randomString(16)+'&text='+vandalisming,'token='+encodeURIComponent(xcrail), function (text, status) { aw1 = eval(text); });
}
else
{
$.post(sitename+'/api.php?action=edit&format=json&title='+pid+'&text='+vandalisming,'token='+encodeURIComponent(xcrail), function (text, status) { aw1 = eval(text); });
}
}
console.log(aw1);
aw1 = eval(aw1);
}
if(times >= lmd)
{
print("<span style='color:red;'>失败:无法进行编辑操作,重试"+lmd+"次之后仍无法编辑。</span>");
throw("Can't edit");
}
try{
if(aw1.error.code = "nosuchpageid")
{
print("编辑失败,正在重试。");
times++
gettoken();
}
}
catch(e)
{
if(firstedit == 0)
{
firstedit = 1
setTimeout("delay3();",delay);
}else{
print("成功在页面发广告:"+aw1.edit.title);
setTimeout("delay3();",delay);
}
}
}
//print部分
var printedmessage
function print(message)
{
if(printedmessage==undefined)
{
printedmessage = ""
}
printedmessage = printedmessage + message +"<br>"
document.getElementById('bodyContent').innerHTML=printedmessage;
}
//延时部分
function delay3()
{
gettime();
print("成功发送广告->,距离下一次发送还有3秒。");
setTimeout("delay2();",delay);
}
function delay2()
{
print("成功发送广告->,距离下一次发送还有2秒。");
setTimeout("delay1();",delay);
}
function delay1()
{
print("成功发送广告->,距离下一次发送还有1秒。");
refreshvandalism();
setTimeout("gettoken();",delay);
}
//计时器
function gettime()
{
var time3
times = 0
time2 = time1
time3 = new Date().getTime()
time1 = new Date().getTime()+delay*3
print("本次散发广告用时"+(time3-time2)+"ms");
}
//随机字符串
function randomString(len) {
  len = len || 32;
  var $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
  var maxPos = $chars.length;
  var pwd = '';
  for (i = 0; i < len; i++) {
//0~32的整数
    pwd += $chars.charAt(Math.floor(Math.random() * (maxPos+1)));
  }
  return pwd;
}
/*<div style="background:#18C3F4;z-index:9999;color:#fff;opacity:.99;margin-top:-60px;">
<span style="font-family:'segoe ui semilight','segoe ui',sans-serif;font-size:110px;line-height:150px;margin-left:-7px;font-family:segoe ui,sans-serif">小!曹!铁!路!好!<br>快!加!曹!铁!群!</span>
<p style="font-size:25px;font-family:微软雅黑,Microsoft YaHei,Microsoft JhengHei,sans-serif">小.曹.铁.路.快.加.群,小.曹.铁.路平.天.下。<br>小.曹.铁.路.默.秒.全,快.加小.曹.铁.路群。22..1.3.1.22.84。</p>
<p style="margin-top:15px;font-size:13px;opacity:.8;text-shadow:0 0 2px rgba(255,255,255,.7);font-family:微软雅黑,Microsoft YaHei,Microsoft JhengHei,sans-serif">曹さん鉄.道,Bilibili最高注目数.の鉄道,100万ファンを持つ,.無料加.QQ..群、xi.aoca.o201.5のファンになる,今は硬貨を投げて。</p></div>.
<div style="outline:9999px solid #18C3F4;"></div>*/
/*
更新日志:
1.0 初次发布
1.1 增加绕过滥用过滤器功能
1.2 自动和谐词库改进
1.3 增加傀儡检测
1.4 增加错误机制
1.5 增加print机制
1.6 增加账号被封禁的检测
1.7 增加在sitename设置错误时的404检测
1.8 增加重试机制
1.9 增加自定义重试次数
2.0 增加广告延时,每次3秒
2.1 增加散发广告时长计时功能
2.2 修复第一次运行时can't read 'edit' of undefined的bug
2.3 可以选择是否绕过滥用过滤器
2.4 大规模更新
2.5 加入并发编辑、随机字符串页面名字,编辑提速,最快1500次/分(delay=1 thread=15的情况下,根据网速而异)
*/
@RujiaZhang

This comment has been minimized.

Copy link

@RujiaZhang RujiaZhang commented Oct 16, 2016

Excited!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment