Add viewcomic scraper
This commit is contained in:
parent
4d7686eccd
commit
4321c75ddd
1 changed files with 39 additions and 0 deletions
39
viewcomic.scraper.user.js
Normal file
39
viewcomic.scraper.user.js
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
// -*- tab-width: 4; js-indent-level: 4; -*-
|
||||
// ==UserScript==
|
||||
// @name Viewcomic Scraper
|
||||
// @namespace danielrayjones
|
||||
// @version 0.0.1
|
||||
// @description Scrape comics from viewcomic.com
|
||||
// @author Dan Jones
|
||||
// @match http://viewcomic.com/*
|
||||
// @grant none
|
||||
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
|
||||
// @require https://raw.githubusercontent.com/tommcfarlin/konami-code/master/src/jquery.konami.min.js
|
||||
// ==/UserScript==
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
$(window).konami({
|
||||
code: [71,69,84],
|
||||
eventName: 'konami.get'
|
||||
});
|
||||
|
||||
$(window).on('konami.get', getStuff);
|
||||
|
||||
function getStuff() {
|
||||
let i = 0;
|
||||
|
||||
$('div.separator a img').each(function () {
|
||||
let $el = $('<a>');
|
||||
$(document.body).append($el);
|
||||
|
||||
$el.attr('href', this.src);
|
||||
$el.attr('download', (i < 10 ? '00' : '0' ) + i + '.jpg');
|
||||
$el.get(0).click();
|
||||
|
||||
i = i+1;
|
||||
});
|
||||
}
|
||||
|
||||
})();
|
||||
Loading…
Add table
Add a link
Reference in a new issue