Decklog WS Deck Output

try to take over the world!

目前為 2021-03-11 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Decklog WS Deck Output
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://www.google.com/search?q=3000%2B2200%2B1200&oq=3000%2B2200%2B1200&aqs=chrome..69i57.46542j0j4&sourceid=chrome&ie=UTF-8
// @grant        none
// ==/UserScript==


function ButtonClickAction (zEvent) {
    try {
        var list = document.querySelectorAll('.card-item.col-xl-2.col-lg-3.col-sm-4.col-6');
    } catch (e) {
        console.error(e.message);
    }
    for (let item of list) {
        // console.log(item.getElementsByTagName("img")[0].getAttribute("data-src"));
        // console.log(item.getElementsByClassName("num")[0].innerHTML);
        document.write(item.getElementsByTagName("img")[0].getAttribute("data-src")," ", item.getElementsByClassName("num")[0].innerHTML,"<BR>");
    }
    const textArea = document.querySelector('body');
    console.log(textArea.innerText)
    downloadToFile(textArea.innerText, 'deck.txt', 'text/plain');
}
window.onload = function() {
    var zNode = document.createElement ('div');
    zNode.innerHTML = '<button id="myButton" type="button">'
        + 'Create TSDB</button>'
    ;
    zNode.setAttribute ('id', 'myContainer');
    document.body.appendChild (zNode);
    document.getElementById ("myButton").addEventListener (
        "click", ButtonClickAction, false
    );
};

const downloadToFile = (content, filename, contentType) => {
  const a = document.createElement('a');
  const file = new Blob([content], {type: contentType});
  a.href= URL.createObjectURL(file);
  a.download = filename;
  a.click();

	URL.revokeObjectURL(a.href);
};

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址