Is it Down?

Simply pulls from TrackerStatus API.

目前为 2020-01-28 提交的版本。查看 最新版本

// ==UserScript==
// @name         Is it Down?
// @version      0.1.1
// @namespace    https://gf.qytechs.cn/en/users/113783-klattering
// @description  Simply pulls from TrackerStatus API.
// @match        https://redacted.ch/*
// ==/UserScript==

(function() {
    'use strict';

    console.log(document.body);
    const trackerStatus = document.createElement('div');
    const message = document.createElement('p');
    message.style.color = 'white';
    message.style.textAlign = 'center';
    message.style.fontWeight = 'bold';
    message.style.margin = '0';
    let messageText;

    document.body.prepend(trackerStatus);
    trackerStatus.append(message);

    var request = new XMLHttpRequest();

    request.open('POST', 'https://cors-anywhere.herokuapp.com/https://red.trackerstatus.info/api/all/', true)
    request.onload = function() {

        var services = JSON.parse(this.response);


        if (request.status >= 200 && request.status < 400) {
            Object.entries(services).forEach(service => {
                if (service[1].Status === "0") {
                    trackerStatus.style.background = '#a00e0e';
                    trackerStatus.style.padding = '.25rem';
                    console.log(service[0]);
                    if (service[0] === "TrackerHTTP" || service[0] === "TrackerHTTPS") {
                        messageText = "The tracker is currently experiencing technical difficulties. <a style=\"color:white; text-decoration:underline\" href=\"https://red.trackerstatus.info\">More info</a>";
                    }
                } else {
                }
            });
        } else {
            console.log('error')
        }

        message.innerHTML = messageText;
    }

    request.send();

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址