Greasy Fork is available in English.

SIS001 TXTDOWN

SIS001 小说下载

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         SIS001 TXTDOWN
// @namespace    http://tampermonkey.net/
// @version      2.0
// @description  SIS001 小说下载
// @author       brackrock12
// @match        http://38.103.161.134/forum/viewthread.php?tid=*
// @require      https://cdn.jsdelivr.net/npm/[email protected]/FileSaver.min.js
// ==/UserScript==

(function () {
    'use strict';




    function down() {
        const h1 = document.querySelector('.mainbox > h1:nth-child(2)')
        console.log(h1)
        let ce = document.createElement('a');
        ce.id = 'CDownBtn';
        ce.textContent = '单章下载';
        ce.style.color = 'blue';
        ce.style.textDecoration = "underline";
        // ce.href='javascript:void(0)'
        ce.onclick = function () { downtext(document); };
        h1.append(ce);


        function removeElement(doc, ele) {
            var elelist = doc.querySelectorAll(ele);
            for (const e of elelist) {
                e.remove()
            }
        }

        function downtext() {
            const con = document.querySelector('div.t_msgfont:nth-child(1)')
            console.log(con)
            removeElement(con, 'strong')
            removeElement(con, 'table')
            removeElement(con, 'strong')


            let btitle = h1.innerText.replace('[同人衍生]', '').replace('单章下载', '')
            let str = con.innerText
            let blob = new Blob([btitle + '\r\n', str], { type: "text/plain;charset=utf-8" });
            saveAs(blob, btitle + ".txt");
            ce.style.color = 'red';
        }



        setTimeout(downtext, 600);

    }


    down()


})();