From c215ffc87cd4b5bc0ee51961f6d2041f60b88ed9 Mon Sep 17 00:00:00 2001 From: Dan Jones Date: Mon, 17 Sep 2018 10:56:12 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Command=20to=20add=20individuals?= =?UTF-8?q?=20downloads=20on=20weekly=20pack=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comicshq.pack.individual.links.user.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 comicshq.pack.individual.links.user.js diff --git a/comicshq.pack.individual.links.user.js b/comicshq.pack.individual.links.user.js new file mode 100644 index 0000000..eded9a3 --- /dev/null +++ b/comicshq.pack.individual.links.user.js @@ -0,0 +1,15 @@ +// https://thecomicshq.com/comics/weekly-packs/weekly-comic-checklist-9-12-18/ + +document.querySelectorAll('.listing-item a').forEach(function (link) { + fetch(link.attributes.href.value) + .then(res => res.text()) + .then(function (text) { + link.parentElement.appendChild(document.createElement('br')); + + let dom = (new DOMParser()).parseFromString(text, "text/html"); + let links = dom.querySelectorAll('.td-post-content a.su-button') + let importLinks = [...links].map(node => document.importNode(node, true)); + importLinks.forEach(node => link.parentElement.appendChild(node)); + }); +}); +