您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
This script combines the chapter texts into one text and collects the audio links.
当前为
// ==UserScript== // @name Blinkist "Today's Free Blink" text scraper ("new-reader") // @description This script combines the chapter texts into one text and collects the audio links. // @namespace http://tampermonkey.net/ // @version 0.4 // @author scr1ptst3r // @match https://www.blinkist.com/de/nc/new-reader/* // @match https://www.blinkist.com/en/nc/new-reader/* // @icon https://www.google.com/s2/favicons?sz=64&domain=blinkist.com // @grant none // @license MIT // ==/UserScript== /* jshint esversion: 6 */ (function () { 'use strict'; window.addEventListener('load', () => { setTimeout(() => { const sbtn = document.createElement("button") sbtn.innerText = "START AUTO-SCRAPER" sbtn.setAttribute("data-scraper-btn","") sbtn.style.cssText = ` position:fixed; top:5px; left:50%; transform:translateX(-50%); font-size:16px; border:1px solid #bbb; cursor:pointer; border-radius:8px; z-index:9999; padding:4px 9px; background-color:rgb(255, 193, 7); color:#000; font-weight:900` document.body.appendChild(sbtn) sbtn.addEventListener("click", function () { function nextChapter() { if (document.querySelector(".reader-content__next").style.display != "none") { setTimeout(() => { document.querySelector(".reader-content__next").click() nextChapter() }, 1500) } } nextChapter() sbtn.remove() }) if (document.querySelector("[data-test-id=keyIdeas]")) { document.querySelector("[data-test-id=keyIdeas]").addEventListener("click", function () { if(document.querySelector("[data-scraper-btn]")){ document.querySelector("[data-scraper-btn]").remove() } } ) } if (document.querySelector(".reader-content__next")) { document.querySelector(".reader-content__next").addEventListener("click", function () { if(document.querySelector("[data-scraper-btn]")){ document.querySelector("[data-scraper-btn]").remove() } copyText() setTimeout(() => { if (document.querySelector(".reader-content__next").style.display === "none") { if (!document.querySelector("[data-copy-btn]")){ const el1 = document.createElement("button") el1.innerText = "COPY" el1.style.cssText = ` position:fixed; top:5px; left:50%; transform: translateX(-50%); font-size:16px; border:1px solid #bbb; cursor:pointer; border-radius:8px; z-index:9999; padding:4px 9px; background-color:rgb(25, 135, 84); color:white; font-weight:900` el1.setAttribute("data-copy-btn","") document.body.appendChild(el1) el1.addEventListener("click", function () { const el = document.createElement("textarea") el.innerText = decodeURIComponent(document.body.getAttribute("data-content")) el.style.cssText = ` position:fixed; top:0; left:0; width:0; height:0;` el.setAttribute("data-title", document.title) document.body.appendChild(el) el.select() el.setSelectionRange(0, 99999) navigator.clipboard.writeText(el.value) el.remove() const blinkistWindow = window.open("", "Blinkist Text", "top=10,left=10,width=500,height=1000") blinkistWindow.document.write(decodeURIComponent(document.body.getAttribute("data-content")).replace(/\n/g, "<br>")) console.log(decodeURIComponent(document.body.getAttribute("data-content"))) let audioOutput = "" decodeURIComponent(document.body.getAttribute("data-audio")).split("\n").forEach(e => { audioOutput += `<a href="${e}" target="_blank">${e}</a><br><br>` }) const blinkistAudioWindow = window.open("", "Blinkist Audio Links", "top=10,left=520,width=1200,height=1000") blinkistAudioWindow.document.write(audioOutput) console.log(decodeURIComponent(document.body.getAttribute("data-audio"))) }) } } }, 1100) }) } }, 1400) let x = encodeURIComponent(location.pathname.split("/").pop() + ":\n "), y = "" function copyText() { if (document.querySelector(".reader-content")) { x += encodeURIComponent(document.querySelector(".reader-content").innerText.replace("Mark as finished", "") + "\n\n") document.body.setAttribute("data-content", x) } if (document.querySelector("[audio-url]")) { y += encodeURIComponent(document.querySelector("[audio-url]").getAttribute("audio-url") + "\n") document.body.setAttribute("data-audio", y) } } }) })();