Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Supermathie/946c0dad04951ff2ac7c0ffb1a64a563 to your computer and use it in GitHub Desktop.
Save Supermathie/946c0dad04951ff2ac7c0ffb1a64a563 to your computer and use it in GitHub Desktop.
HB download link extract
var pattern = /(MOBI|EPUB|PDF|CBZ|PDF \(HQ\))$/i;
var out = "";
var nodes = document.getElementsByTagName('a');
for (i in nodes) {
var a = nodes[i];
if (a && a.text && pattern.test(a.text.trim())) {
out += a.attributes['data-web'].value;
out += "\n";
}
}
copy(out);
console.log(out);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment