203
个编辑
无编辑摘要 |
|||
第29行: | 第29行: | ||
$("<button type='button' onclick='fan2();'>!TSOP</button>").insertAfter(oon); | $("<button type='button' onclick='fan2();'>!TSOP</button>").insertAfter(oon); | ||
</syntaxhighlight> | |||
==='''<big> 房间保持器 </big>'''=== | |||
通过不停私信自己来保持房间(和自身)的存活。 | |||
相比起泡泡机和报时器,减少了刷屏(对他人来说)。 | |||
使用前需要填入自己的id,和要私信自己的句子。 | |||
id要准确,句子不能为空。<syntaxhighlight lang="javascript" line="1"> | |||
myname=["在此填入自己的id","在此填入要私信自己的句子"]; | |||
// | |||
x0 = 0 | |||
RU=room.users | |||
function gett(){ | |||
RUN=RU[x0].name | |||
if (RUN==myname[0] && x0<30){ | |||
xid = RU[x0].id | |||
} | |||
else if(x0>=30){ | |||
xid = "undefined"; | |||
} | |||
else{ | |||
x0=x0+1 | |||
gett() | |||
} | |||
} | |||
gett(myname[0]); | |||
function Keepalive(){ | |||
$.post("#",{message:""+myname[1],to:""+xid}) | |||
} | |||
Keepalive(); | |||
setInterval(function(){ | |||
Keepalive(); | |||
},1200000) | |||
//👆这个数字是每次私信的间隔时间,1200000毫秒是20分钟 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
第99行: | 第141行: | ||
这个功能可以把网易云的歌单做成一个JSON串 | 这个功能可以把网易云的歌单 或是日推 做成一个JSON串 | ||
配合下面的自动音乐播放器使用 | 配合下面的自动音乐播放器使用 | ||
第136行: | 第178行: | ||
x_time = time2( $(tbody+">:nth-child("+x11+")> td:nth-child(3)> span ").textContent ); | 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; | x_author = $(tbody+">:nth-child("+x11+") > td:nth-child(4) > div").title; | ||
//剔除无效链接👇 | |||
if (tr_class == 'even js-dis' || tr_class == " js-dis" ){ | if (tr_class == 'even js-dis' || tr_class == " js-dis" ){ | ||
第144行: | 第187行: | ||
x11 = x11+1; | x11 = x11+1; | ||
} | } | ||
//剔除无效链接👆 | |||
} | } | ||
第151行: | 第195行: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==='''自动音乐播放器'''=== | ==='''自动音乐播放器''' === | ||
第161行: | 第205行: | ||
下一首按钮用来切歌/开始播放。<syntaxhighlight lang="javascript" line="1"> | 下一首按钮用来切歌/开始播放。<syntaxhighlight lang="javascript" line="1"> | ||
function drr(namee,url,author){ | var drr = function drr(namee,url,author){ | ||
$("# | $.post("#",{message:"/share "+url+" "+namee+" - "+author}) | ||
} | } | ||
function a4(){ | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
var a4 = function a4(){ | |||
//检查播放状态 | //检查播放状态 | ||
var div_class = document.querySelector("body> | var div_class = document.querySelector("body > div.sweet-alert.showSweetAlert.visible").className | ||
setTimeout(function(){ | setTimeout(function(){ | ||
if (div_class == "sweet-alert showSweetAlert visible"){ | if (div_class == "sweet-alert showSweetAlert visible"){ | ||
document.querySelector("body > div.sweet-alert.showSweetAlert.visible > div.sa-button-container > div > button").click(); | document.querySelector("body > div.sweet-alert.showSweetAlert.visible > div.sa-button-container > div > button").click(); | ||
zanting(); | |||
} | } | ||
}, | },2000); | ||
setTimeout(function(){ | setTimeout(function(){ | ||
if($("#musicBox > div > div.progress-music").attr("class") == "progress-music"){ | if($("#musicBox > div > div.progress-music").attr("class") == "progress-music"){ | ||
bofangqi(); | bofangqi(); | ||
第183行: | 第225行: | ||
},45000); | },45000); | ||
} | } | ||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
var oon = $("#message> div.room-submit-wrap> input") | var oon = $("#message> div.room-submit-wrap> input") | ||
$("<button type='button' onclick='aaa();' id = 'aab'>循环:开启</button>").insertAfter(oon); | $("<button type='button' onclick='aaa();' id = 'aab'>循环:开启</button>").insertAfter(oon); | ||
var fst = true; | var fst = true; | ||
function aaa(){ | var aaa = function aaa(){ | ||
if (fst == true){ | if (fst == true){ | ||
var element=document.getElementById("aab"); | var element=document.getElementById("aab"); | ||
第199行: | 第242行: | ||
} | } | ||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
$("<button type='button' onclick='lianbo();' id = 'aac'>连播:开启</button>").insertAfter(oon); | $("<button type='button' onclick='lianbo();' id = 'aac'>连播:开启</button>").insertAfter(oon); | ||
var lib = true; | var lib = true; | ||
function lianbo(){ | var lianbo = function lianbo(){ | ||
if (lib == true){ | if (lib == true){ | ||
var element=document.getElementById("aac"); | var element=document.getElementById("aac"); | ||
第214行: | 第258行: | ||
} | } | ||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
bfq1 = 0; | bfq1 = 0; | ||
$("<button type='button' onclick=' | |||
$("<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>'JSON'<Textarea id = 'JSON' cols = '4' rows = '1' value = 'JSON' > </Textarea></p>").insertAfter(oon); | ||
$("<p>间隔时 | $("<p>间隔时 间<Textarea id = 'TIMEE' cols = '4' rows = '1' value = 'TIMEEE' > </Textarea> 毫秒</p>").insertAfter(oon); | ||
$("#TIMEE").val("3000") | $("#TIMEE").val("3000") | ||
var bbc24 = function bbc24(){ | |||
$("#JSON").val(""); | |||
bfq1 = 0; | |||
} | |||
setT = setTimeout(x345=1,3000); | setT = setTimeout(x345=1,3000); | ||
function bofangqi(){ | var bofangqi = function bofangqi(){ | ||
x2 = JSON.parse( $("#JSON").val() ); | x2 = JSON.parse( $("#JSON").val() ); | ||
x2_length = x2.length-1; | x2_length = x2.length-1; | ||
musicbox = $("#musicBox > div > div.progress-music").attr("class"); | musicbox = $("#musicBox > div > div.progress-music").attr("class"); | ||
if ( bfq1<=x2_length && lib == true && musicbox =="progress-music" ){ | if ( bfq1<=x2_length && lib == true && musicbox =="progress-music" ){ | ||
clearTimeout(setT); | clearTimeout(setT); | ||
js1 = x2[bfq1]; | js1 = x2[bfq1]; | ||
第244行: | 第297行: | ||
else if(musicbox == "progress-music active"){ | else if(musicbox == "progress-music active"){ | ||
setT = setTimeout(bofangqi,15000); | 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{} | 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> | ||
个编辑