自动获取所有SSR

try to take over the world!

目前為 2019-08-05 提交的版本,檢視 最新版本

// ==UserScript==
// @name         自动获取所有SSR
// @namespace    http://www.cichui.top/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://www.akgs.ml/free_ssr*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    window.getSsrData = function (){
        var ssrStr='';
        var count = 1;
        for(var i=1;i<=parseInt(count/90+(count%90>0?1:0));i++)
        {
            layui.$.ajax({
                type:"GET",
                url:"https://www.akgs.ml/api/free_ssr?page="+i+"&limit=90",
                dataType: "json",
                async: false,
                success: function(data) {
                    count = data.count;
                    for(var j=0; j<data.data.length;j++){
                        if(data.data[j].m_station_cn_status)
                            ssrStr+=data.data[j].ssrlink+"\n\n";
                    }
                }
            });
        }
        layer.open({
            area:'800px',
            offset: 't',
            content: '<span style="color:red;">全选复制后在任务栏ssr图标上点击右键选择剪贴板批量导入</span><br><textarea style="width:100%;height:600px" id="ssrStr" disabled>'+ssrStr+'</textarea>'
        });
        return ssrStr;
    }
    console.log(window.getSsrData());
    // Your code here...
})();