ICVE 考试助手引用库

动态替换在线用户查询接口

目前為 2020-06-06 提交的版本,檢視 最新版本

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/404781/813122/ICVE%20%E8%80%83%E8%AF%95%E5%8A%A9%E6%89%8B%E5%BC%95%E7%94%A8%E5%BA%93.js

async function apiAnswer(q) {
    const _list = []
    let a1 = requestAPI('GET', `https://wk.92e.win/api/tdlib.php?q=${encodeURIComponent(q)}&token=${token(q)}`, { headers: { "referer": "https://wk.92e.win/wk.html" } })
    // let a2 = requestAPI('GET', `http://qs.nnarea.cn/chaoxing_war/topicServlet?action=query&q=${encodeURIComponent(q)}`)
    let a3 = requestAPI('GET', `https://wk.92e.win/formust.php?q=${encodeURIComponent(q)}&token=${token(q)}`, { headers: { "referer": "https://wk.92e.win/wk.html" } })
    let a4 = requestAPI('GET', `https://wk.92e.win/api/api-3.php?q=${encodeURIComponent(q)}&token=${token(q)}`, { headers: { "referer": "https://wk.92e.win/wk.html" } })

    try {
        let results = await Promise.all([a4, a1, a3])
        debugger
        results.forEach(e => {
            if (e.responseText) {
                const submitBody = {
                    _id: '',
                    q: '',
                    a: [],
                    o: [],
                    t: -1,
                    s: ""
                }
                try {
                    const url = e.finalUrl;
                    console.log(e.responseText);
                    if (url.match(/.*qs\.nnarea\.cn/)) {
                        const json = JSON.parse(e.responseText)
                        if (json.code == '1') {
                            submitBody._id = token(new Date().getTime()) + "" + rnd(100, 100000)
                            submitBody.q = json.question
                            submitBody.a.push(json.data)
                            _list.push(submitBody)
                        }
                    } else {
                        const json = JSON.parse(e.responseText)
                        if ((json.code === undefined && json.code !== 0) || json.code === undefined) {
                            submitBody._id = token(new Date().getTime()) + "" + rnd(100, 100000)
                            submitBody.q = json.tm
                            debugger
                            submitBody.a.push(json.answer)
                            _list.push(submitBody)
                        }
                    }
                } catch (e) {
                    console.log(e);
                }
                if (_list.length != 0)
                    requestAPI("PUT", "http://39.96.64.75/s", {
                        headers: { "Content-Type": "application/json;charset=utf-8" },
                        data: JSON.stringify(_list)
                    })
            }
            //todo 需提交
            // else if (url.match(/.*api\/tmlib/)) {
            // } else if (url.match(/.*api\/morepng/)) {
            // } else if (url.match(/.*\/fortest/)) {
            // }
        })
        return _list.map(e => {
            return {
                'question': e.q,
                'answer': e.a,
                'options': e.o,
            }
        })
    } catch (e) {
        console.log(e);
        return [{
            'question': "未搜索到答案或接口出现问题",
            'answer': "如果您是购买使用,请举报售卖方,本脚本完全免费开源使用",
            'options': "请自行修改接口或联系作者",
        }]
    }

}

QingJ © 2025

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