JSFiddle - React, Tailwind, and code Playground
by epoch
JavaScript
javascript: (function(d, s, e, f) {
var list, arr = $("a.magnet").map(function(e, t) {
var n = $.trim($(t.parentNode).prev().text()),
r = n.split(/\s+/g),
i = /S(0\d{1}|\d{2})E(0\d{1}|\de{2})/im.exec(n),
m = $(t).attr('href');
if (!i) {
i = [0, 0]
}
return {
raw: n,
words: r,
season: i[1],
episode: i[2],
magnet: m
}
}).map(function(t, n) {
if ((!s || +n.season === +s) && (!e || +n.episode >= +e)) {
var fs = f ? f.split(/s+/g) : [], am = true, x = 0, res = '';
res += (d ? '#' + n.raw + '\n' : '');
if (f && fs.length) {
for (; x < fs.length; x++) {
if (n.words.indexOf($.trim(fs[x])) < 0) {
am = false;
break;
}
}
if (am) {
res += n.magnet;
return res;
}
} else {
res += n.magnet;
return res;
}
}
});
list = Array.prototype.slice.call(arr).join("\n\n");
with (window.open()) {
document.write('<textarea id="t" style="width:100%; height:100%;">' + list + "</textarea>");
document.close()
}
})(confirm("Debug Mode?"), prompt("Season? (==)"), prompt("Episode? (>=)"), prompt('Filters? ex: "f1 f2 f3"'))