.
*
*/
header("Content-Type: text/javascript");
$host1 = filter_input(INPUT_GET, "h", FILTER_SANITIZE_STRING);
if ($host1 == "mbfier.com") {
$host = "mbfier.com";
} else if ($host1 === "mbfy.it") {
$host = "mbfy.it";
} else {
echo("hots parameter error.");
exit(0);
}
$targetDomain = filter_input(INPUT_GET, "td", FILTER_SANITIZE_STRING);
if (substr($targetDomain, 0, 4) == "www.") {
$cleanTargetDomain = substr($targetDomain, 4);
} else {
$cleanTargetDomain = $targetDomain;
}
$cleanTargetDomain = ucfirst($cleanTargetDomain);
$ipos = mb_strripos("~" . $cleanTargetDomain, ".");
if ($ipos) {
$galTitle = strtoupper(substr($cleanTargetDomain, 0, $ipos-1));
} else {
$targetDomain = $targetDomain . ".com";
echo("window.open('http://" . $targetDomain . "." . $host . "','_self');");
exit(0);
}
$output1 = filter_input(INPUT_GET, "out", FILTER_SANITIZE_STRING);
$output1 = strtolower($output1);
if ($output1 == "json") {
$output = 2; // set flag for json output
} else if ($output1 === "std") {
$output = 1; // set flag for standard output
} else {
echo("out parameter error.");
exit(0);
}
$verbose1 = filter_input(INPUT_GET, "v", FILTER_SANITIZE_STRING);
if ($verbose1 == "0") {
$verbose = 0; // set flag for defalt app verbosity
} else if ($verbose1 === "1") {
$verbose = 1; // set flag for quite verbosity
} else {
echo("verbose parameter error.");
exit(0);
}
?>
/*
* Mbfier, 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 = ;
var verbose = ;
var host = "";
var targetDomain = "";
var galTitle = "";
var landingPage = "";
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.