您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
突出今日主题;
- // ==UserScript==
- // @name Hupu Highlight
- // @namespace King(legendlee)
- // @description 突出今日主题;
- // @include http://bbs.hupu.com/*
- // @version 1.0
- // ==/UserScript==
- var all_data_td, this_td;
- all_data_td = document.evaluate(
- "//table[@id='ajaxtable']//td[@class='smalltxt']",
- document,
- null,
- XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
- null);
- if (all_data_td.snapshotLength == 0) { //new_style
- all_data_td = document.evaluate(
- "//table[@id='pl']//td[@class='p_author']",
- document,
- null,
- XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
- null);
- }
- var date = new Date();
- var year= date.getFullYear().toString();
- var month = (date.getMonth()+1).toString();
- var day = date.getDate().toString();
- if(month.length == 1) {
- month = "0" + month;
- }
- if(day.length == 1) {
- day = "0" + day;
- }
- var today_str = year + "-" + month + "-" + day;
- date.setDate(date.getDate()-1);
- month = (date.getMonth()+1).toString();
- day = date.getDate().toString();
- if(month.length == 1) {
- month = "0" + month;
- }
- if(day.length == 1) {
- day = "0" + day;
- }
- var yesterday_str = year + "-" + month + "-" + day;
- var reg_today = new RegExp(today_str);
- var reg_yesterday = new RegExp(yesterday_str);
- for (var i = 0; i < all_data_td.snapshotLength; i++) {
- this_td = all_data_td.snapshotItem(i);
- var html = this_td.innerHTML;
- if(reg_today.test(html)){
- this_td.parentNode.style.backgroundColor = '#FFFFCC';
- this_td.parentNode.style.fontWeight = "bold";
- }
- if(reg_yesterday.test(html)){
- this_td.parentNode.style.backgroundColor = '#CCFFFF';
- this_td.parentNode.style.fontWeight = "bold";
- }
- }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址