|
|
第119行: |
第119行: |
| x(); | | x(); |
| setInterval(x,20*60*1000); | | setInterval(x,20*60*1000); |
| </syntaxhighlight>
| |
|
| |
|
| |
| ==='''网易歌单JSON生成器'''===
| |
|
| |
|
| |
| 这个功能可以把网易云的歌单或是日推做成一个JSON串
| |
|
| |
| 配合下面的自动音乐播放器使用
| |
| <syntaxhighlight lang="javascript" line="1">
| |
| 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
| |
| </syntaxhighlight>
| |
|
| |
| ==='''自动音乐播放器'''===
| |
|
| |
|
| |
| 这个功能用来自动连播音乐。
| |
|
| |
| JSON输入栏用来输入JSON串。
| |
|
| |
| 循环按钮用来控制循环开启/关闭。
| |
|
| |
| 下一首按钮用来切歌/开始播放。<syntaxhighlight lang="javascript" line="1">
| |
| 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>');
| |
| </syntaxhighlight> | | </syntaxhighlight> |
|
| |
|
用以进行一些简(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);
留言區
|
|
@蛤猹鳴泣之時
|
這些狗屎是本著「不需要安裝別的插件」為起點寫出來的,所以上面的這些玩意都可以用瀏覽器F12打開控制台輸入來使用。
用手機端看可能腳本縮進會很奇怪。
當然大部分手機瀏覽器也沒法打開控制台就是了。
|
|
|
|
|