您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Fetch and display official scores for users from their profile pages next to their name on Join Game page.
当前为
// ==UserScript== // @name AWBW Join Game (Lobby) Show Players Official Scores // @namespace https://awbw.amarriner.com/ // @version 0.31 // @description Fetch and display official scores for users from their profile pages next to their name on Join Game page. // @author Hollen9 // @license MIT // @match https://awbw.amarriner.com/gameswait.php // @match https://awbw.amarriner.com/yourgames.php // @match https://awbw.amarriner.com/yourturn.php // @grant GM.xmlHttpRequest // @grant GM_setValue // @grant GM_getValue // ==/UserScript== (function() { 'use strict'; var fetchInterval = 60 * 60 * 1000; // 60 minutes in milliseconds var delayBetweenRequests = 1000; // 1 second in milliseconds function fetchUserScore(username) { var userData = GM_getValue(username); var currentTime = Date.now(); // Update display with existing data if available if (userData) { updateLinkDisplay(username, userData.score); } // Fetch new data if none exists or if it's outdated if (!userData || currentTime - userData.lastFetch >= fetchInterval) { GM.xmlHttpRequest({ method: "GET", url: 'https://awbw.amarriner.com/profile.php?username=' + username, onload: function(response) { var parser = new DOMParser(); var doc = parser.parseFromString(response.responseText, "text/html"); // var scoreElement = doc.querySelector('#profile_page > table:nth-child(1) > tbody > tr > td:nth-child(1) > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(5) > td:nth-child(2)'); //var score = scoreElement ? scoreElement.innerText.trim() : 'N/A'; var ratingLabelElement = Array.from(doc.querySelectorAll('#profile_page td')).find(td => td.textContent.trim() === "Official Rating:"); var scoreElement = ratingLabelElement ? ratingLabelElement.nextElementSibling : null; var score = scoreElement ? scoreElement.innerText.trim() : 'N/A'; GM_setValue(username, { score: score, lastFetch: Date.now() }); updateLinkDisplay(username, score); scheduleNextUser(true); // Delay only after a new fetch } }); } else { scheduleNextUser(false); // No delay for local data } } function updateLinkDisplay(username, score) { var linksToUpdate = document.querySelectorAll('.norm[href*="profile.php?username=' + username + '"]'); linksToUpdate.forEach(function(link) { // Check if the text is wrapped in <b> or <i> var bold = link.querySelector('b'); var italic = link.querySelector('i'); if (bold) { bold.textContent = username + ' (' + score + ')'; } else if (italic) { italic.textContent = username + ' (' + score + ')'; } else { link.textContent = username + ' (' + score + ')'; } }); } function scheduleNextUser(shouldDelay) { if (userQueue.length > 0) { var delay = shouldDelay ? delayBetweenRequests : 0; if (shouldDelay) { setTimeout(shiftNext, delay); } else { shiftNext(); } } } function shiftNext() { var nextUsername = userQueue.shift(); fetchUserScore(nextUsername); } function extractUsernameFromLink(link) { var match = link.match(/username=(.*)$/); return match ? decodeURIComponent(match[1]) : null; } // Initialize the queue var userQueue = Array.from(document.querySelectorAll('.norm[href*="profile.php?username="]')) .map(link => extractUsernameFromLink(link.href)) .filter(username => username != null); // Start processing the queue scheduleNextUser(false); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址