您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
根據巴哈給的文章ip顯示對應的國旗
当前为
// ==UserScript== // @name 巴哈姆特之顯示文章ip所在國籍 // @description 根據巴哈給的文章ip顯示對應的國旗 // @namespace nathan60107 // @author nathan60107(貝果) // @version 1.5 // @license MIT // @homepage https://home.gamer.com.tw/homeindex.php?owner=nathan60107 // @match https://forum.gamer.com.tw/C* // @icon https://forum.gamer.com.tw/favicon.ico // @grant GM_xmlhttpRequest // @connect ip-api.com // @run-at document-end // @noframes // ==/UserScript== (function() { let bahaip = "104.16.181.30" let rawips = jQuery(".edittime.tippy-post-info").map(function() { return this.dataset.hideip; }).toArray() let ips = rawips.map(item => { if(item.match(/\d+.\d+.\d+.xxx/)){ return item.replace("xxx", "000") }else{ return bahaip } }) function setCountryFlag(rawdata){ let data = JSON.parse(rawdata.response) let users = jQuery(".c-post__header__author") for(let i = 0; i < Math.min(data.length, users.length); i++){ let img = (ips[i] === bahaip) ? `https://forum.gamer.com.tw/favicon.ico` : `https://flagicons.lipis.dev/flags/4x3/${data[i].countryCode.toLowerCase()}.svg` jQuery(users[i].children[0]).after(`<img src="${img}" title="${data[i].country}" style="vertical-align: middle; height: 26px; border-radius:4px;">`) } } GM_xmlhttpRequest ( { method: "POST", url: "http://ip-api.com/batch?fields=countryCode,country", data: JSON.stringify(ips), headers: { "Content-Type": "application/x-www-form-urlencoded" }, onload: setCountryFlag, } ); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址