泥头车工坊
用以进行一些简(ruo)单(zhi)聊天室小功能开发的房间,此界面做存放处用
——by 哈茶
!TSOP按钮
这个功能用来在 "POST!" 按钮的边上增加一个 "!TSOP" 按钮。
如按钮的字面意思所言,这个按钮的作用是把输入框里的内容倒着发送出去。
var oon = $("#message> div.room-submit-wrap> input")
function fan(a1,b=[""]){
a = a1+"";
mes2 = a.length-1;
while (mes2>=0){
b.push(a[mes2]);
mes2 = mes2-1;
}
back1 = b.join("");
return back1;
}
function fan2(){
mes = document.querySelector("#message > div.room-input-wrap > textarea").value;
$.post("#",{message: "/me"+fan(mes)});
$("[name='message']").val("");
}
$("<button type='button' onclick='fan2();'>!TSOP</button>").insertAfter(oon);
房间保持器
通过不停私信自己来保持房间(和自身)的存活。
相比起泡泡机和报时器,减少了刷屏(对他人来说)。
postt=()=>{$.post("#",{message:"keepalive",to:""+profile.id})}
setInterval(postt,1200000)
时间标记
这个功能用来在每条聊天内容下方标记它被发出来的时间。
当然,只有自己能看到。
(意义不明)
$('#talks').bind('DOMNodeInserted',function(){
TIm = new Date();
tim5 = ("↑"+TIm.getHours()+"点"+TIm.getMinutes()+"分"+TIm.getSeconds()+"秒↑");
hua = $("div#talks>:first-child");
if ($("div#talks>:eq(1)").attr("class") == "nope"){}
else{
$("<span id='dema' class ='nope' ></span>").insertAfter(hua);
document.getElementById("dema").innerHTML=tim5
}
});
自爆式失忆喷雾
慎用
啊,这是什么?失忆喷雾?喷一下。
啊,这是什么?失忆喷雾?喷一下。
啊,这是什么?失忆喷雾?喷一下。
啊,这是什么?失忆喷雾?喷一下。
啊,这是什么?失忆喷雾?喷一下。
Time1 = 3000;
WhatIsTihs=()=>{
$.post("#",{message:"啊,这是什么?失忆喷雾?喷一下。",to:""+profile.id})
setTimeout(WhatIsTihs,1500)
Time1 =Time1-500
}
WhatIsTihs();
说书脚本
这个功能用来将长文本分割开来并逐句发送。
在输入框下方新增加的输入框内放入文本。 可设置分割符与说书速度。
//由于存在被用来刷屏的风险,此脚本被削除
//
冒泡君
这个功能用来每20分钟生成一串随机的泡泡。
(?) 作用类似报时。
pao = [ "O", "o", "〇","·","0",".",""];
x=(ran2=0,ran3="")=>{
while (ran2 <= 40){
ran3 = ran3+pao[Math.floor(Math.random()*pao.length)]
ran2 = ran2+1;
}
$.post("#",{message: "/me冒泡"+ran3});
};
x();
setInterval(x,20*60*1000);
网易歌单JSON生成器
这个功能可以把网易云的歌单或是日推做成一个JSON串
配合下面的自动音乐播放器使用
function time2(tim){
ti2 = tim.split(":");
ti3 = ti2[0]*60*1000+ti2[1]*1000;
return ti3;
}
///////////////////////////////////////////////
function wyzfc(zfc){
var zfc_l = zfc.length;
var zfc2 = zfc.slice(30,zfc_l)
var zfc3 = "https://link.hhtjim.com/163/"+zfc2+".mp3";
return zfc3;
}
/////////////////////////////////
var obj1 = [];
function nameurl(a_name,a_url,a_time,a_author){
obj2 = {name:a_name , url:a_url , time:a_time , author:a_author}
obj1.push(obj2);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function wyy(){
x11 = 1;
var tbody = ".m-table >tbody"
var x_length = $(tbody).childNodes.length;
while(x11<=x_length){
tr_class= $(tbody+">:nth-child("+ x11 +")").className;
x1 = tbody + ">:nth-child("+ x11 +")> td:nth-child(2) > div > div > div > span > a";
x_url = wyzfc($(x1).href);
x_name = $(x1+">b").title;
x_time = time2( $(tbody+">:nth-child("+x11+")> td:nth-child(3)> span ").textContent );
x_author = $(tbody+">:nth-child("+x11+") > td:nth-child(4) > div").title;
//剔除无效链接👇
if (tr_class == 'even js-dis' || tr_class == " js-dis" ){
x11 = x11+1;
}
else{
nameurl(x_name,x_url,x_time,x_author);
x11 = x11+1;
}
//剔除无效链接👆
}
}
wyy();
obj1
自动音乐播放器
这个功能用来自动连播音乐。
JSON输入栏用来输入JSON串。
循环按钮用来控制循环开启/关闭。
下一首按钮用来切歌/开始播放。
var drr = function drr(namee,url,author){
$.post("#",{message:"/share "+url+" "+namee+" - "+author})
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var a4 = function a4(){
//检查播放状态
var div_class = document.querySelector("body > div.sweet-alert.showSweetAlert.visible").className
setTimeout(function(){
if (div_class == "sweet-alert showSweetAlert visible"){
document.querySelector("body > div.sweet-alert.showSweetAlert.visible > div.sa-button-container > div > button").click();
zanting();
}
},2000);
setTimeout(function(){
if($("#musicBox > div > div.progress-music").attr("class") == "progress-music"){
bofangqi();
}
},45000);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var oon = $("#message> div.room-submit-wrap> input")
$("<button type='button' onclick='aaa();' id = 'aab'>循环:开启</button>").insertAfter(oon);
var fst = true;
var aaa = function aaa(){
if (fst == true){
var element=document.getElementById("aab");
element.innerHTML="循环:关闭";
fst = false;
}
else if(fst == false){
var element=document.getElementById("aab");
element.innerHTML="循环:开启";
fst = true;
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$("<button type='button' onclick='lianbo();' id = 'aac'>连播:开启</button>").insertAfter(oon);
var lib = true;
var lianbo = function lianbo(){
if (lib == true){
var element=document.getElementById("aac");
element.innerHTML="连播:关闭";
lib = false;
}
else if(lib == false){
var element=document.getElementById("aac");
element.innerHTML="连播:开启";
lib = true;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bfq1 = 0;
$("<button type='button' onclick='zanting();' id = 'a12'>下一首</button>").insertAfter(oon);
$("<button type='button' onclick='bbc24();' id = 'bbc'>清空列表</button>").insertAfter(oon);
$("<p>'JSON'<Textarea id = 'JSON' cols = '4' rows = '1' value = 'JSON' > </Textarea></p>").insertAfter(oon);
$("<p>间隔时间<Textarea id = 'TIMEE' cols = '4' rows = '1' value = 'TIMEEE' > </Textarea>毫秒</p>").insertAfter(oon);
$("#TIMEE").val("3000")
var bbc24 = function bbc24(){
$("#JSON").val("");
bfq1 = 0;
}
setT = setTimeout(x345=1,3000);
var bofangqi = function bofangqi(){
x2 = JSON.parse( $("#JSON").val() );
x2_length = x2.length-1;
musicbox = $("#musicBox > div > div.progress-music").attr("class");
if ( bfq1<=x2_length && lib == true && musicbox =="progress-music" ){
clearTimeout(setT);
js1 = x2[bfq1];
drr(js1.name,js1.url,js1.author)
bfq1 = bfq1+1;
setT = setTimeout(bofangqi,js1.time +parseInt($("#TIMEE").val()));
}
else if ( bfq1 > x2_length , fst == true && lib == true && musicbox =="progress-music"){
bfq1 = 0;
setT = setTimeout(bofangqi,0);
}
else if(musicbox == "progress-music active"){
setT = setTimeout(bofangqi,15000);
}
else{
a4();
}
}
var zanting = function zanting(){
document.querySelector("#play-or-pause").click();
setInterval(bofangqi(),3000)
}
////////////////////////////////////////////////////////////////////////
var aab = function aab(){
if ($("#musicBox > div > div.progress-music.active").attr("aria-valuenow")=="NaN"){
a4();
}
else{}
}
$('#talks').bind('DOMNodeInserted', function () {
if ($("div#talks>:first-child").attr("class") == "talk music system select-text"){
setTimeout( function(){ aab()},2000);
}
else{}
});
$("body").append('<script>'+drr+a4+aaa+'fst = true;'+'lib = true;'+'setT = setTimeout(x345=1,3000);'+zanting+'bfq1 = 0;'+bbc24+bofangqi+aab+aaa+'</script>');
@蛤猹鸣泣之时 | 这些狗屎是本着“不需要安装别的插件”为起点写出来的,所以上面的这些玩意都可以用浏览器F12打开控制台输入来使用。
用手机端看可能脚本缩进会很奇怪。 当然大部分手机浏览器也没法打开控制台就是了。 |