Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript: var imgs = document.getElementsByTagName("img");
- function download(data, filename, type) {
- var file = new Blob([data], {
- type: type
- });
- if (window.navigator.msSaveOrOpenBlob) window.navigator.msSaveOrOpenBlob(file, filename);
- else {
- var a = document.createElement("a"),
- url = URL.createObjectURL(file);
- a.href = url;
- a.download = filename;
- document.body.appendChild(a);
- a.click();
- setTimeout(function() {
- document.body.removeChild(a);
- window.URL.revokeObjectURL(url);
- }, 0);
- }
- }
- function getElementsByXPath(xpath, parent) {
- let results = [];
- let query = document.evaluate(xpath, parent || document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
- for (let i = 0, length = query.snapshotLength; i < length; ++i) {
- results.push(query.snapshotItem(i));
- }
- return results;
- }
- var imgSrcs = [];
- var p1 = getElementsByXPath("/html/head/meta[13]")[0].content.split("_")[0];
- var lembar = Number(getElementsByXPath('/html/body/script[6]/text()')[0].data.split('"pageCount":')[1].split(',')[0]);
- var judul = document.title.replace(" - issuu", "");
- for (var i = 1; i <= lembar; i++) {
- imgSrcs.push(p1 + "_" + i + ".jpg")
- }
- var turl = "";
- var hasil = "<!DOCTYPE html>";
- hasil = hasil + "<html lang='en'>";
- hasil = hasil + " <head>";
- hasil = hasil + " <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>";
- hasil = hasil + " <meta http-equiv='X-UA-Compatible' content='IE=edge'>";
- hasil = hasil + " <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'>";
- hasil = hasil + " <title>" + judul + "</title>";
- hasil = hasil + " <meta name='description' content='lightGallery lets you to create animated thumbnails for your gallery with the help of thumbnail plugin.'>";
- hasil = hasil + " <link href='https://sachinchoolur.github.io/lightGallery/static/css/main.css' rel='stylesheet'>";
- hasil = hasil + " <link href='https://sachinchoolur.github.io/lightGallery/static/css/justifiedGallery.min.css' rel='stylesheet'>";
- hasil = hasil + " <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700' rel='stylesheet' type='text/css'>";
- hasil = hasil + " <link href='https://sachinchoolur.github.io/lightGallery/lightgallery/css/lightgallery.css' rel='stylesheet'>";
- hasil = hasil + " </head>";
- hasil = hasil + " <body class='demos'>";
- hasil = hasil + " <section class='section pdb0'>";
- hasil = hasil + " <div class='container-fluid'>";
- hasil = hasil + " <div class='section-header has-desc mrb50'>";
- hasil = hasil + " <h3 class='page-header mrb15'><a href='" + window.location + "'>" + judul + "</a></h3>";
- hasil = hasil + " </div>";
- hasil = hasil + " <div class='demo-gallery mrb30'>";
- hasil = hasil + " <div id='aniimated-thumbnials' class='list-unstyled justified-gallery' style='height: 800px;'>";
- for (var i = 0; i < imgSrcs.length; i++) {
- turl = imgSrcs[i].replace(".jpg", "_thumb_medium.jpg");
- hasil = hasil + " <a class='jg-entry hoverZoomLink' href='" + imgSrcs[i] + "' data-sub-html='" + judul + " " + i + "' style='width: 187px; height: 126.144px; top: 6px; left: 6px; opacity: 1;'>";
- hasil = hasil + " <img class='img-responsive' src='" + turl + "' style='width: 187px; height: 127px; margin-left: -93.5px; margin-top: -63.5px;'>";
- hasil = hasil + " <div class='demo-gallery-poster'><img src='https://sachinchoolur.github.io/lightGallery/static/img/zoom.png'></div>";
- hasil = hasil + " </a>";
- }
- hasil = hasil + " </div>";
- hasil = hasil + " </div>";
- hasil = hasil + " </div>";
- hasil = hasil + " </section>";
- hasil = hasil + " <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js'></script>";
- hasil = hasil + " <script src='https://sachinchoolur.github.io/lightGallery/static/js/prettify.js'></script>";
- hasil = hasil + " <script src='https://sachinchoolur.github.io/lightGallery/static/js/jquery.justifiedGallery.min.js'></script>";
- hasil = hasil + " <script src='https://sachinchoolur.github.io/lightGallery/static/js/transition.js'></script>";
- hasil = hasil + " <script src='https://sachinchoolur.github.io/lightGallery/static/js/collapse.js'></script>";
- hasil = hasil + " <script src='https://sachinchoolur.github.io/lightGallery/lightgallery/js/lightgallery.js'></script>";
- hasil = hasil + " <script src='https://sachinchoolur.github.io/lightGallery/lightgallery/js/lg-fullscreen.js'></script>";
- hasil = hasil + " <script src='https://sachinchoolur.github.io/lightGallery/lightgallery/js/lg-thumbnail.js'></script>";
- hasil = hasil + " <script src='https://sachinchoolur.github.io/lightGallery/lightgallery/js/lg-video.js'></script>";
- hasil = hasil + " <script src='https://sachinchoolur.github.io/lightGallery/lightgallery/js/lg-autoplay.js'></script>";
- hasil = hasil + " <script src='https://sachinchoolur.github.io/lightGallery/lightgallery/js/lg-zoom.js'></script>";
- hasil = hasil + " <script src='https://sachinchoolur.github.io/lightGallery/external/jquery.mousewheel.min.js'></script>";
- hasil = hasil + " <script src='https://sachinchoolur.github.io/lightGallery/static/js/demos.js'></script>";
- hasil = hasil + " </body>";
- hasil = hasil + "</html>";
- download(hasil, judul + ".html", "text/html")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement