你才会停止追逐|

ricky_lin

园龄:3年8个月粉丝:11关注:2

洛谷内卷监视工具(升级版)

v0.1

upsdate on 2023.11.07

较原版内卷监视工具,增加了一下功能:

  • 计分板(宏观掌控他人的卷题数量和难度分布)
  • 多次连续AC相同题目去重

可能会不定时更新

有什么建议可以提出

code for v0.1
var userlist =
["ricky_lin","Query_Failed",
"The_Last_Candy",
"Jeefy",
"Rairn",
"hfjh",
"fsfdgdg",
"aish"];<!--观察成员列表-->
var pages = 1; <!-- 初始检查做题记录页数,建议设置为 1-2 -->
var cd = 10000; <!-- 自动检查每个人时间间隔,建议保持为 10000,以免 GG-->
var a = [[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0]];<!--各个难度的做题数量 有几个人就要复制几个[0,0,0,0,0,0,0,0]-->
var pre=[0,0,0,0,0,0,0,0];<!--上一个做的题 0的数量和人的数量要相等-->
var numcnt=[0,0,0,0,0,0,0,0];<!--做题数量统计 0的数量和人的数量要相等-->
var colors=['rgb(191, 191, 191)','rgb(254, 76, 97)','rgb(243, 156, 17)','rgb(255, 193, 22)','rgb(82, 196, 26)','rgb(52, 152, 219)','rgb(157, 61, 207)','rgb(14, 29, 105)'];
var name="灰红橙黄绿蓝紫黑";
var lst=Array();
var cnt=0;
function onSearch(obj)
{
var storeId=document.getElementById('store');
var gradeId=document.getElementByld('grade');
var rowsLength=storeId.rows.length;
var key=document.getElementById('key').value;
for(var i=1;i < rowsLength;i++)
{
var searchText=storeId.rows[i].cells[0].innerHTML;
if(key=="*"||searchText.match(key))
storeId.rows[i].style.display='';
else
storeId.rows[i].style.display='none';
}
};
str='<div><select onchange="onSearch()" name="key" id="key"><option value="*">*</option>';
for(var i=0;i < userlist.length;i++)
str+='<option value="'+userlist[i]+'">'+userlist[i]+'</option>';
str+='</select></div><table id="grade" style="white-space: nowrap;"><thead><tr><th>用户</th><th>题目数量</th>'
for(var i=0; i < 8;i++)
str+= '<th>' +"<a style='color:"+colors[i]+"'>"+ name[i] + '</a></th>';
str+='</tr></thead><tbody>';
str+='</tbody></table><table id="store" style="white-space: nowrap;"><tr><th>用户</th><th>题号</th><th>标题</th></tr></table>';
document.body.innerHTML = "<h1 style='text-align:center;color:red;font-family:Microsoft Yahei'>内卷监视工具(升级版)</h1>";
document.body.innerHTML += "<b style='text-align:center;'>author:<a href='https://www.luogu.com.cn/user/78206'>ricky_lin</a></b>";
document.body.innerHTML += "<b style='text-align:center;font-family:FangSong'>运筹首页之中,偷袭千里之外&#128517;</b><hr>" + str;
<!-- Output Emoji & Option -->
function PARSE(First=false)
{
cnt=(cnt+1)%userlist.length;
var user=userlist[cnt];
var Pagenum=1;if(First)Pagenum=pages;
for(;Pagenum>0;Pagenum--)
{
var httpRequest=new XMLHttpRequest();
httpRequest.open('GET','https://www.luogu.com.cn/record/list?user='+user+'&status=12&page='+Pagenum,false);
httpRequest.send();
if(httpRequest.readyState==4&&httpRequest.status==200)
{
var content=httpRequest.responseText;
var patten=/decodeURIComponent\(".*?"\)/;
content=patten.exec(content)[0];
content=content.substr(20,content.length-22);
content=JSON.parse(decodeURIComponent(content));
var prob,col,pid,title;
for(var i=Math.min(content.currentData.records.result.length-1,19);i>=0;i--)
if(content.currentData.records.result[i].status==12&&content.currentData.records.result[i].id>lst[cnt])
{
prob=content.currentData.records.result[i].problem;
col=colors[prob.difficulty];
pid=prob.pid;
title=prob.title;
if(!First && pid != pre[cnt]){
document.getElementById('store').childNodes[0].innerHTML
+='<tr><td>'+user+'</td><td>'+pid+'</td><td>'+
"<a style='color:"+col+"' href='https://www.luogu.com.cn/problem/"+pid+"' target='_blank'>"
+title+"</a>"+'</td></tr>';
alert(user+" 刚刚卷了"+name[prob.difficulty]+"题 "+pid+" "+title);
++numcnt[cnt];
++a[cnt][prob.difficulty];
}
pre[cnt]=pid;
lst[cnt]=content.currentData.records.result[i].id
}
}
}
str = "<thead><tr><th>用户</th><th>题目数量</th>";
for(var i=0; i < 8;i++)
str+= '<th>' +"<a style='color:"+colors[i]+"'>"+ name[i] + '</a></th>';
str+='</tr></thead><tbody>';
for(var i=0;i < userlist.length;i++){
str+='<tr><td>'+userlist[i]+'</td><td>'+numcnt[i]+'</td>';
for(var j=0; j < 8;j++){
str+='<td>'+a[i][j]+'</td>';
}
str+='</tr>';
}
document.getElementById('grade').childNodes[0].innerHTML=str;
}
for(var i=0;i < userlist.length;i++) lst[i]=0;
for(var i=0;i < userlist.length;i++)PARSE(true);
window.setInterval(PARSE,cd);

v0.2

update on 2023.12.05

更新了以下内容:

  • 解决了只能从脚本开始后记录卷题情况的问题,将其拓展到了脚本运行的当天开始
  • 选择框可以控制计分板了
code for v0.2
var userlist =
["ricky_lin","Smallbasic",
"The_Last_Candy",
"Jeefy",
"Rairn",
"hfjh",
"fsfdgdg",
"aish"];<!--观察成员列表-->
var lstt = 12;
var opentime = Math.round(new Date().getTime()/1000);
var tbegin = Math.round(new Date().getTime()/1000) + (8 * 3600);
tbegin -= tbegin % 86400;
var pages = 1; <!-- 初始检查做题记录页数,建议设置为 1-2 -->
var cd = 10000; <!-- 自动检查每个人时间间隔,建议保持为 10000,以免 GG-->
var a = [[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0]];<!--各个难度的做题数量 有几个人就要复制几个[0,0,0,0,0,0,0,0]-->
var pre=[0,0,0,0,0,0,0,0];<!--上一个做的题 0的数量和人的数量要相等-->
var numcnt=[0,0,0,0,0,0,0,0];<!--做题数量统计 0的数量和人的数量要相等-->
var colors=['rgb(191, 191, 191)','rgb(254, 76, 97)','rgb(243, 156, 17)','rgb(255, 193, 22)','rgb(82, 196, 26)','rgb(52, 152, 219)','rgb(157, 61, 207)','rgb(14, 29, 105)'];
var name="灰红橙黄绿蓝紫黑";
var lst=Array();
var cnt=0;
function onSearch(obj)
{
var gradeId=document.getElementById('grade');
var storeId=document.getElementById('store');
var rowsLength=storeId.rows.length;
var key=document.getElementById('key').value;
for(var i=1;i < rowsLength;i++)
{
var searchText=storeId.rows[i].cells[0].innerHTML;
if(key=="*"||searchText.match(key)){
storeId.rows[i].style.display='';
}
else{
storeId.rows[i].style.display='none';
}
}
rowsLength=gradeId.rows.length;
key=document.getElementById('key').value;
for(var i=1;i < rowsLength;i++)
{
var searchText=gradeId.rows[i].cells[0].innerHTML;
if(key=="*"||searchText.match(key)){
gradeId.rows[i].style.display='';
}
else{
gradeId.rows[i].style.display='none';
}
}
};
str='<div><select onchange="onSearch()" name="key" id="key"><option value="*">*</option>';
for(var i=0;i < userlist.length;i++)
str+='<option value="'+userlist[i]+'">'+userlist[i]+'</option>';
str+='</select></div><table id="grade" style="white-space: nowrap;"><thead><tr><th>用户</th><th>题目数量</th>'
for(var i=0; i < 8;i++)
str+= '<th>' +"<a style='color:"+colors[i]+"'>"+ name[i] + '</a></th>';
str+='</tr></thead><tbody>';
str+='</tbody></table><table id="store" style="white-space: nowrap;"><tr><th>用户</th><th>题号</th><th>标题</th></tr></table>';
document.body.innerHTML = "<h1 style='text-align:center;color:red;font-family:Microsoft Yahei'>内卷监视工具(升级版)</h1>";
document.body.innerHTML += "<b style='text-align:center;'>author:<a href='https://www.luogu.com.cn/user/78206'>ricky_lin</a></b>";
document.body.innerHTML += "<b style='text-align:center;font-family:FangSong'>运筹首页之中,偷袭千里之外&#128517;</b><hr>" + str;
<!-- Output Emoji & Option -->
function PARSE(First=false)
{
cnt=(cnt+1)%userlist.length;
var user=userlist[cnt];
var Pagenum=1;
lstt = tbegin;
for(;lstt >= tbegin;Pagenum++)
{
var httpRequest=new XMLHttpRequest();
httpRequest.open('GET','https://www.luogu.com.cn/record/list?user='+user+'&status=12&page='+Pagenum,false);
httpRequest.send();
if(httpRequest.readyState==4&&httpRequest.status==200)
{
var content=httpRequest.responseText;
var patten=/decodeURIComponent\(".*?"\)/;
content=patten.exec(content)[0];
content=content.substr(20,content.length-22);
content=JSON.parse(decodeURIComponent(content));
var prob,col,pid,title;
for(var i=Math.min(content.currentData.records.result.length-1,19);i>=0;i--){
lstt = content.currentData.records.result[i].submitTime;
if(content.currentData.records.result[i].status==12&&content.currentData.records.result[i].id>lst[cnt])
{
prob=content.currentData.records.result[i].problem;
col=colors[prob.difficulty];
pid=prob.pid;
title=prob.title;
if(tbegin <= lstt && pid != pre[cnt]){
document.getElementById('store').childNodes[0].innerHTML
+='<tr><td>'+user+'</td><td>'+pid+'</td><td>'+
"<a style='color:"+col+"' href='https://www.luogu.com.cn/problem/"+pid+"' target='_blank'>"
+title+"</a>"+'</td></tr>';
if(lstt >= opentime) alert(user+" 刚刚卷了"+name[prob.difficulty]+"题 "+pid+" "+title);
++numcnt[cnt];
++a[cnt][prob.difficulty];
}
pre[cnt]=pid;
lst[cnt]=content.currentData.records.result[i].id
}
}
}
}
str = "<thead><tr><th>用户</th><th>题目数量</th>";
for(var i=0; i < 8;i++)
str+= '<th>' +"<a style='color:"+colors[i]+"'>"+ name[i] + '</a></th>';
str+='</tr></thead><tbody>';
for(var i=0;i < userlist.length;i++){
str+='<tr><td>'+userlist[i]+'</td><td>'+numcnt[i]+'</td>';
for(var j=0; j < 8;j++){
str+='<td>'+a[i][j]+'</td>';
}
str+='</tr>';
}
document.getElementById('grade').childNodes[0].innerHTML=str;
}
for(var i=0;i < userlist.length;i++) lst[i]=0;
for(var i=0;i < userlist.length;i++)PARSE(true);
window.setInterval(PARSE,cd);
posted @   ricky_lin  阅读(590)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起
  1. 1 有我 周深
有我 - 周深
00:00 / 00:00
An audio error has occurred.

作词 : 唐恬/闫光宇

作曲 : 钱雷

编曲 : 赵兆/付虹宇

制作人 : 赵兆

出品 : 共青团中央宣传部

版权 : 中国青少年新媒体协会

制作单位 : 能量悦动音乐

发行单位 : 银河方舟StarNation

出品人 : 郭峰

总监制 : 汤杰

总策划 : 钟亚楠

总统筹 : 金慧子

音乐监制 : 李天鹏/李三木

制作执行 : 张不贰/高聪怡

项目宣发 : 肖健/张国党/孙小千/戴胤/孙雯璟

音乐推广 : 代诗琪/杜思潮/马越/程铁峰/傅之豪

钢琴 : 赵兆

吉他 : 伍凌枫

贝斯 : 韩阳

鼓 : 武勇恒

合唱设计 : 赵兆

合唱 : 凡尔赛合唱团

人声录音 : 耿潇微

人声录音室 : 55TEC Studio Beijing

配唱 : 徐威@52Hz Studio (Shanghai)

混音 : 李游(小骷髅)@55TEC Studio Beijing

海报 : 格子

特别鸣谢 : 周深工作室

世界问 你是谁 来自哪 请回答

爱什么 梦什么 去何方 请回答

答案有 一百年的时光

我来自 硝烟中 课桌旁 的太阳

我来自 硝烟中 课桌旁 的太阳

他和她 宣的誓 迎的仗

来自那 燃烧的 和我一样 的年华

来自世间 一对平凡的夫妻 身旁

来自世间 一对平凡的夫妻 身旁

来自昨天 谁以青春赴万丈 理想

我是寸土 不让的 家乡啊

我是绝不 低头的 倔强啊

接过万千热血 的初衷

当有对答世界 的音量

要怎么形容明天 像我一样

要怎么形容明天 像我一样

承风骨亦有锋芒 有梦则刚

去何方 去最高 的想象

前往皓月星辰 初心不忘

那未来如何登场 有我担当

那未来如何登场 有我担当

定是你只能叫好 那种辉光

护身旁 战远方 有我啊

我的名字就是 站立的地方

Wu~

我的样子 就是 明天的模样

我是朝阳 落在乡间听书声 朗朗

我是朝阳 落在乡间听书声 朗朗

我是屏障 为谁挡一程厄运 的墙

我要一生 清澈地 爱着啊

我要长歌 领着风 踏着浪

朝着星辰大海 的方向

当有对答世界 的音量

要怎么形容明天 像我一样

要怎么形容明天 像我一样

承风骨亦有锋芒 有梦则刚

去远方 去最高 的想象

前往皓月星辰 初心不忘

那未来如何登场 有我担当

那未来如何登场 有我担当

定是你只能叫好 那种辉光

护身旁 战远方 有我啊

一生骄傲为我 站立的地方

Wu~

我的样子 就是 中国的模样

Wu~~~ Wu~~~

当炬火 去化作那道光

“谨以此歌献给一代代不负时代重托的中国青年”

“谨以此歌献给一代代不负时代重托的中国青年”