Greasy Fork

Greasy Fork is available in English.

GBT小组游戏空间种子列表下载

try to take over the world!

当前为 2020-07-12 提交的版本,查看 最新版本

// ==UserScript==
// @name         GBT小组游戏空间种子列表下载
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        http://renxufeng.ys168.com/
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

function download(filename, text) {
  var element = document.createElement('a');
  element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
  element.setAttribute('download', filename);

  element.style.display = 'none';
  document.body.appendChild(element);

  element.click();

  document.body.removeChild(element);
}

function main() {
    var jobs = document.querySelectorAll('.ml')
    var t=500
    for (let i of jobs) {
        setTimeout(()=>{i.click()}, t);
        t+=1000
    }

    setTimeout(()=> {
        var content = ''
        var urls = document.querySelectorAll('.xwj a')
        for (let i of urls) {
            content += i.href
            content += '\n'
            console.log(i.href)
        }
        download("ys168-files.txt", content)
    }, jobs.length * 1100)
}
setTimeout(main, 2000)
})();