Skip to content

Instantly share code, notes, and snippets.

@symant233
Last active September 28, 2021 06:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save symant233/748bbf99eb0aa3d9bda97d92b549d2f2 to your computer and use it in GitHub Desktop.
Save symant233/748bbf99eb0aa3d9bda97d92b549d2f2 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name 武汉科技大学选课系统去除其他校区
// @namespace https://github.com/symant233
// @version 0.0.1
// @description 武汉科技大学选课系统 去除其他校区
// @author symant233
// @icon https://cdn.jsdelivr.net/gh/symant233/PublicTools/Beautify/Bkela.png
// @require https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js
// @match http://59.68.177.189/pyxx/pygl/pyjhxk.aspx
// @grant GM_addStyle
// @license GPL-3.0
// @homepageURL https://github.com/symant233
// ==/UserScript==
;(function() {
// 武汉科技大学选课系统 去除其他校区
function filter() {
const tmp = document.querySelectorAll('#dgData tr');
let count = 0;
for ( let i in tmp ) {
if ( !tmp[i].innerText ) return;
if ( tmp[i].innerText.includes("青山校区") || tmp[i].innerText.includes('中心医院') ) {
tmp[i].remove();
console.log('[rm]' + tmp[i].textContent.replace(/\s+/g, ' ').trim());
count++;
}
if (tmp[i].style.backgroundColor === "rgb(0, 0, 0)") tmp[i].style.backgroundColor = '#6fa7f8';
}
console.log(`[Beautify] 本次过滤共移除了 ${count} 条内容.`);
}
$('<button id="btn-filter" style="position:fixed;top:29px;left:0px;width:28px;">过滤</button>').appendTo('body');
$('#btn-filter').click(filter);
setTimeout(() => {filter()}, 600);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment