storiesonline depaginator

De-paginates stories on storiesonline.net

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         storiesonline depaginator
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  De-paginates stories on storiesonline.net
// @author       You
// @match        https://storiesonline.net/s/*/*
// @grant        none
// ==/UserScript==

let scr = document.createElement("script");

scr.src = "https://code.jquery.com/jquery-3.3.1.min.js";

scr.onload = function() {
    if (!document.querySelector(".pager")) {
        let arr = Array.from($(".tolink"));

        if (arr.length === 0) arr = Array.from($(".link"));

        arr.forEach(el => $(el).load(el.children[0].href + " article"));

        let chapters = arr.length;

        setTimeout(function() {
            Array.from($(".end")).forEach(el => el.remove());
            Array.from($(".date")).forEach(el => el.remove());
        }, chapters * 1000);
    } else {
        let moreChapters = Number(document.querySelector(".pager").children[document.querySelector(".pager").children.length - 2].innerText);
        for (let i = 1; i < moreChapters; i++) {
            $.ajax({
              type: "GET",
              url: window.location.href + "?page=" + i.toString(),
              async: false,
              success: function(data) {
                  $("article")[0].innerHTML += $($.parseHTML(data)).find("article")[0].innerHTML;
              }
            });
        }
        Array.from($(".pager")).forEach(el => el.remove());
        Array.from($(".conTag")).forEach(el => el.remove());
        Array.from($("header")).forEach((el, i) => {if (i !== 0) el.remove();});
        Array.from($(".end")).forEach(el => el.remove());
    }
};

document.querySelector("head").appendChild(scr);


for (let sheet of document.styleSheets) {
    sheet.disabled = true;
}