Skip to content

Instantly share code, notes, and snippets.

@julenwang
Last active June 29, 2023 10:35
Show Gist options
  • Save julenwang/df4035af577b50b062bcf9d4474fc3be to your computer and use it in GitHub Desktop.
Save julenwang/df4035af577b50b062bcf9d4474fc3be to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name copyNcRawsAllUrls.js
// @version 0.3.0
// @description 2023/06/29
// @author Julen
// @match https://ouo.si/*
// @grant none
// ==/UserScript==
(function () {
let nav = document.querySelector("nav");
if (nav) {
let btn = document.createElement("button");
btn.type = "button";
btn.textContent = "copy所有磁力链";
nav.appendChild(btn);
btn.onclick = () => {
let result = Array.from(document.querySelectorAll("table>tbody>tr"))
.map((tr) => tr.querySelector('.tr-links>a').href)
.reduce((acc, cur) => {
return `${acc}${cur}\n`;
}, "");
window.navigator.clipboard.writeText(result);
};
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment