您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Nofifies new messages on the BBRT website through scraping.
// ==UserScript== // @name BBRT notifier // @namespace http://blog.regularoddity.com/ // @version 0.3 // @description Nofifies new messages on the BBRT website through scraping. // @author E E // @match https://www.barebackrt.com/members/default.php // @icon https://www.barebackrt.com/favicon.ico // @grant GM_notification // @license MIT License // ==/UserScript== /* esversion: 6 */ (function() { 'use strict'; let messages = 0; const Query = 'emailLogo'; let getNode = function() { let doc = top.window.frames[1].document.children[0]; let xpath = document.evaluate('//span[@id="emailLogo"]', doc); return xpath.iterateNext(); }; setInterval(function() { let node = getNode(); let count; if (!node) { count = 0; } else { let text = node.textContent; text = text.substring(1); count = parseInt(text); } if (count > messages) { GM_notification( count === 1 ? 'There is a message on BBRT.' : `There are ${count} messages on BBRT.`); } messages = count; }, 2000); })();