/*
* Mobifier, the gallery bot
* Copyright (C) 2021 Daniele Bonini
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
*/
var recNum = 0;
var nImgProcessed = 0;
var output = 1;
var verbose = 0;
var host = "mbfy.it";
var targetDomain = "example.com";
var galTitle = "EXAMPLE";
var landingPage = "Example.com";
var crawlres = [];
var logoFound = false;
function loadDoc() {
recNum++;
bConnectionOK = false;
if (verbose===0 && recNum===1) {
document.write("Copyrights (C) 2021 Daniele Bonini. GNU General Public License ver3 ");
document.write(" ");
document.write("This is a bit of doc: ");
document.write("- out: std (for standard output) or json ");
document.write("- v: 0 (for standard verbosity) or 1 (for quite output) ");
document.write(" ");
document.write("The service is running and trying to connect to the target server. ");
document.write("The connection to the target web server can eventually fail. ");
document.write("Cause could be found among the following reasons: ");
document.write("- Internet connection lost. ");
document.write("- DNS failure. ");
document.write("- Target server is down. ");
document.write("- Access-Control-Allow-Origin header missing on the target server. ");
document.write(" ");
}
var xhttp = new XMLHttpRequest();
if (host == "mbfier.com") {
xhttp.open("GET", "http://"+targetDomain+".mbfier.com/upload.php?url=http://"+targetDomain, true);
} else {
xhttp.open("GET", "http://"+targetDomain+".mbfy.it/upload.php?url=http://"+targetDomain, true);
}
xhttp.send();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
bConnectionOK = true;
if (verbose===0) {
document.write("Connection succeeded.