Skip to content

Commit

Permalink
[ccassandra/extract.js] Try fix from tardypad#89 (#31)
Browse files Browse the repository at this point in the history
Even though this fix was originally dismissed as not elegant, it is far better than a broken CCassandra plugin!  In general, I disagree with the notion that not everything reasonably feasible with JavaScript is allowed.  For details, see tardypad#89

Furthermore this scheme seems to be generically applicable to comic strips from `tapas.io`.
  • Loading branch information
Olf0 committed Oct 2, 2023
1 parent 4651541 commit 6b6c015
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions plugins/ccassandra/extract.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
function(page) {
var regex = /<img[^&]*src="([^"]*media.tumblr.com\/[^"]*)"/;
var regex = /<a\sclass="ga-tracking\sjs-episode\s+"(.|\s)+?href="([^"]+)"/
var match = regex.exec(page);
return match[1].replace("_500","_1280");
var url = "https://tapas.io" + match[2]
var xhr = new XMLHttpRequest();
xhr.open("GET", url , false);
xhr.send(null);
if(xhr.status === 200)
{
var newPage = xhr.responseText;
var regex2 = /<img\s*src="([^"]*)"\sclass="content__img"/
var match2 = regex2.exec(newPage);
return match2[1];
}
}

0 comments on commit 6b6c015

Please sign in to comment.