妖火热帖

try to take over the world!

Version vom 01.10.2022. Aktuellste Version

// ==UserScript==
// @name         妖火热帖
// @namespace    https://yaohuo.me/
// @version      0.4
// @description  try to take over the world!
// @author       id:30235
// @match        https://yaohuo.me/
// @icon         https://yaohuo.me/css/favicon.ico
// @grant        GM_xmlhttpRequest
// @license      MIT
// @connect yh.jdcc.cf
// @connect 127.0.0.1
// @require    https://lib.baomitu.com/jquery/3.6.0/jquery.js
// ==/UserScript==

(function() {
    let title = document.querySelector('.title');
    let a = document.createElement("a");
    let span = document.createElement("span");
    span.className = "separate";
    a.innerText = "热帖";
    span.innerText = " ";
    a.style.cursor="pointer";
    title.append(span);
    title.append(a);
    a.onclick=function(){
        GM_xmlhttpRequest({
            url:"https://yh.jdcc.cf:2083/getHot",
            method:'get',
            onerror:function(res){
                console.log(res.responseText);
            },
            onload:function(res){
                let data=res.responseText;
                data=JSON.parse(data);
                let rt="";
                for(let i=0;i<data["data"].length;i++){
                    rt+=(i+1)+'.<a href="/bbs-'+data["data"][i][0]+'.html" target="_blank">'+"【"+data["data"][i][4]+"热】"+data["data"][i][3]+'</a><br>';
                }
                rt = '<div class="title"><a href="/">首页</a>&gt;<a href="/bbs/">论坛</a>&gt;热帖 更新于:'+data["updateTime"]+'</div>'+'<div class="list">'+rt+'</div>';
                $("body").html('');
                $("body").append(rt);

            }
        });

    };







})();
长期地址
遇到问题?请前往 GitHub 提 Issues。