您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Converts weather temperature from the NYT website from Fahrenheit to Celsius
当前为
// ==UserScript== // @name NYT Temperature Conversion // @namespace http://tampermonkey.net/ // @version 0.1 // @description Converts weather temperature from the NYT website from Fahrenheit to Celsius // @author Rodrigo García // @match http://international.nytimes.com/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js // @require https://gf.qytechs.cn/scripts/1003-wait-for-key-elements/code/Wait%20for%20key%20elements.js?version=49342 // @grant none // @run-at document-idle // ==/UserScript== /* jshint -W097 */ 'use strict'; waitForKeyElements(".weather-button", convertTemperature); function convertTemperature(jNode) { var weatherButton = document.getElementsByClassName('weather-button')[0]; var fahrenheitString = weatherButton.textContent.trim(); var fahrenheit = fahrenheitString.substr(0,fahrenheitString.length-2); var celsius = Math.round((parseFloat(fahrenheit)-32)*5/9); var celsiusString = celsius.toString()+'°C'; weatherButton.innerHTML = weatherButton.innerHTML.replace(fahrenheitString,celsiusString); }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址