Jinxin Novel Sis001

下载第一会所中的小说

بۇ قوليازمىنى بىۋاسىتە قاچىلاشقا بولمايدۇ. بۇ باشقا قوليازمىلارنىڭ ئىشلىتىشى ئۈچۈن تەمىنلەنگەن ئامبار بولۇپ، ئىشلىتىش ئۈچۈن مېتا كۆرسەتمىسىگە قىستۇرىدىغان كود: // @require https://update.sleazyfork.org/scripts/487798/1330396/Jinxin%20Novel%20Sis001.js

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 or Violentmonkey 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         Jinxin Novel Sis001
// @namespace    https://gitee.com/jinxin11112/tampermonkey
// @version      0.1.2
// @description  下载第一会所中的小说
// @author       jinxin
// @match        https://www.sis001.com/*
// @grant        none
// @license MIT
// ==/UserScript==

class Sis001 {
    'use strict';

    getContent() {
        let contentList = [];
        let main = document.getElementsByName('modactions')[0];
        if (main) {
            let messages = main.getElementsByClassName('mainbox viewthread');
            for (let message of messages) {
                let content = message.getElementsByClassName('t_msgfont noSelect')[0].innerHTML;
                if (content) {
                    content = this.removeGarbled(content);
                    contentList.push(content);
                    contentList.push('\n\n')
                }
            }
        } else {
            let message = document.getElementsByClassName('message')[0];
            let content = message.innerHTML;
            content = this.removeGarbled(content);
            contentList.push(content);
        }
        return contentList;
    }

    removeGarbled(str) {
        if (!str) return str;
        str = str.replace(/ /g, ' ')
        str = str.replace(/<br>/g, '\n')
        return str;
    }

    getTitle() {
        let title = document.title;
        title = title.replace(' - 文学作者区', '');
        title = title.replace(' - SiS001! Board', '');
        title = title.replace(' - [第一会所 关闭注册]', '');
        return title;
    }
}