Free javascript Hosting


48e0f28aa478.js

Uploaded on Nov 25 2021 12:04 by imaduddinmudzakar

// function enableInspect() {
// javascript: (function () {
// var script = document.createElement("script");
// script.src = "//cdn.jsdelivr.net/npm/eruda";
// document.body.appendChild(script);
// script.onload = function () {
// eruda.init();
// };
// })();
// }

// var instagramUserData = null;
// let req = new XMLHttpRequest();
// req.onreadystatechange = () => {
// if (req.readyState == XMLHttpRequest.DONE) {
// instagramUserData = JSON.parse(req.responseText);
// _12367589();
// }
// };
// req.open("GET", "https://www.instagram.com/dshazall/?__a=1", true);
// req.send();
// var followerPost = [];
// function _12367589(){
// // instagramUserData.graphql.user.edge_owner_to_timeline_media.node.dimensions
// for(let i = 0; i < 9 ; i++){
// let res = instagramUserData.graphql.user.edge_owner_to_timeline_media.edges[i].node
// followerPost[res.edge_liked_by.count] = res.shortcode
// }
// //testhere
// console.log("followerPost",followerPost)
// for(const [index,key] of Object.entries(followerPost)){
// console.log(index,key)
// }
// }

// function waitFor(variable, value = null ,callback) {
// let runtime = 200;let maxruntime = 2000;let intervalTime= this.intervalTime;
// var interval = setInterval(function() {
// intervalTime = intervalTime == 0 ? runtime : intervalTime+runtime;
// if (intervalTime == maxruntime || (window[variable] && window[variable] == value) || window[variable] ) {
// clearInterval(interval);
// intervalTime = 0;
// callback();
// }
// }, runtime);
// }

// function sleep(ms) {
// return new Promise(resolve => setTimeout(resolve, ms));
// }

// var likesTotal = [];
// var postsElemArr = document.querySelectorAll("#react-root > section > main > div > div._2z6nI > article > div:nth-child(1) div.v1Nh3 a");

// function _asdas1372613(){
// postsElemArr[0].click();
// sleep(1000);
// var likesElem = document.querySelector("#react-root > section > main > div > div > article > div > div.qF0y9.Igw0E.IwRSH.eGOV_._4EzTm > div > div > section.EDfFK.ygqzn > div > div > a > span").innerHTML;
// likesTotal.push(likesElem.replace(/\D/g,''));
// console.log(likesTotal)
// postsElemArr.splice(0, 1);
// console.log(postsElemArr)
// window.history.back();
// }

// document.addEventListener('DOMContentLoaded', function() {
// console.log('hey')
// }, false);

//--------------------------------------------------------------
//--------------------------------------------------------------
function select(elem) {
let index = Math.floor(Math.random() * elem.length);
try {
elem[index].selected = true;
} catch (e) {
console.log(elem, elem[index]);
}
}

function getElementsByText(str, tag = "a") {
return Array.prototype.slice
.call(document.getElementsByTagName(tag))
.filter((el) => el.textContent.trim() === str.trim());
}

function getPrompt(message, default_ = "") {
let input = prompt(message, default_);
if (!input) {
return default_; //break out of the function early
}
return input;
}

//--------------------------------------------------------------
//--------------------------------------------------------------
var d =
JSON.stringify(new Date().getHours()) +
JSON.stringify(new Date().getMinutes()) +
JSON.stringify(new Date().getSeconds());

var userDat = {
fullName: "demo" + d,
username: "demo" + d,
password: "0172410513Imad.",
emailOrPhone: "60193701294"
};

const setValue = Object.getOwnPropertyDescriptor(
window.HTMLInputElement.prototype,
"value"
).set;
const modifyInput = (name, value) => {
const input = document.getElementsByName(name)[0];
setValue.call(input, value);
input.dispatchEvent(new Event("input", { bubbles: true }));
};

function signupStep1(username = "") {

const submit = () => {
const button = document.querySelector(
"#react-root > section > main > div > div > div:nth-child(1) > div > form > div:nth-child(8) > div > button"
);
button.removeAttribute("disabled");
button.click();
};

if (username) {
userDat.fullName = username;
userDat.username = username;
}

modifyInput("emailOrPhone", userDat.emailOrPhone);
modifyInput("fullName", userDat.username);
modifyInput("username", userDat.fullName);
modifyInput("password", userDat.password);
submit();

setTimeout(() => {
if (confirm("step 2?") == true) {
signupStep2(true);
} else {
if (confirm("Rerun?")) {
signupStep1(prompt("key", ""));
}
}
}, 1000);
}

function signupStep2(store = false) {
if (store) {
getJsonData("account_created");
json_bin_result["account_created"] = userDat;
}

postJsonData("account_created");
document.querySelector('select[title="Year:"]')[23].selected = true;

setTimeout(()=>{
select(document.querySelector('select[title="Month:"]'));

setTimeout(()=>{
select(document.querySelector('select[title="Day:"]'));
getElementsByText("Next", "button")[0].removeAttribute("disabled");

setTimeout(()=>{
document.querySelector('select[title="Year:"]').addEventListener('change', function() {
setTimeout(() => {
getElementsByText("Next", "button")[0].addEventListener('click', function() {
console.log('testhere')
signupStep3();
})
}, 1000);
});
},1000);

},500);
},500)
}

function signupStep3(){
let elem = document.querySelector("#react-root > section > main > div > div > div:nth-child(1) > div > div > div > form > div.TfHme > div > label > input");
setTimeout(()=>{
let pin_code = prompt("PIN CODE","")
modifyInput("confirmationCode", pin_code);
},5000)
}

var intervalTime = 0;
function waitFor(variable, callback) {
console.log(variable, callback)
let runtime = 200;let maxruntime = 10000;
var interval = setInterval(function() {
console.log(variable, callback)
intervalTime = intervalTime == 0 ? runtime : intervalTime+runtime;
if (intervalTime == maxruntime || (variable && (typeof variable == 'array' && variable.length > 0) || (variable && (typeof variable == 'object' && Object.keys(variable).length > 0)) || variable != '')) {
clearInterval(interval);
intervalTime = 0;
callback();
}
}, runtime);
}

function getUserNames() {
let commentelems = document.querySelectorAll(".sqdOP");
let username = [];
for (let i = 0; i < commentelems.length; i++) {
let dat = commentelems[i].href;
if (dat) {
username.push(dat);
}
}

localStorage.setItem("username", username);
console.log(localStorage.getItem("username").split(","));
}

function followUserName() {
setTimeout(() => {
let username = localStorage.getItem("username").split(",");
console.log();
username.splice(0, 1);
localStorage.setItem("username", username);
// console.log(username[0]);
window.location.href = username[0];
}, 1000);
}

var jsonbin_url = [];
var json_bin_result = [];
let json_secret_key =
"$2b$10$mLak5X/SRZrFwk6TkyDLE.Szm9EJEGvgZAuOTKzFeDy/ZzscwVlo.";

jsonbin_url["account_created"] =
"https://api.jsonbin.io/b/61946bf501558c731cc3ae1c";
jsonbin_url["account_to_follow"] =
"https://api.jsonbin.io/b/61946b8162ed886f914f86d4";

function getJsonData(key) {
console.log('getJsonData',key);
// let req = new XMLHttpRequest();

// req.onreadystatechange = () => {
// if (req.readyState == XMLHttpRequest.DONE) {
// console.log(req.responseText)
// json_bin_result[key] = req.responseText;
// }
// };

// req.open("GET", jsonbin_url[key] + "/latest", true);
// req.setRequestHeader("secret-key", json_secret_key);
// req.send();
}

function postJsonData(key) {
console.log('postJsonData',key)
// let req = new XMLHttpRequest();

// req.onreadystatechange = () => {
// if (req.readyState == XMLHttpRequest.DONE) {
// console.log(req.responseText);
// }
// };

// req.open("PUT", jsonbin_url[key], true);
// req.setRequestHeader("Content-Type", "application/json");
// req.setRequestHeader("secret-key", json_secret_key);
// req.send(JSON.stringify(json_bin_result[key]));
}

function openJsonDashboard() {
window.open("https://jsonbin.io/dashboard", "_blank");
}


var maxCount = 0
function LoadAllComments(){

let elem = document.querySelector("#react-root > section > main > div > ul > li > div > button > div");
console.log(elem)
if(maxCount == 10){
console.log("finished")
maxCount = 0
return;
}
if(elem){
elem.scrollIntoView();
elem.click();
setTimeout(()=>{scrollAllComments()},500)
}else{
maxCount++
setTimeout(()=>{scrollAllComments()},500)
}
}



//--------------------------------------------------------------
//--------------------------------------------------------------


html = `
<div>
<div id="navbar_minimize" class="navbar_1998">
<a href="javascript:void(0)" onclick="minimizeNavbar(false)">Open</a>
</div>
<div id="navbar_1998" class="navbar_1998">
<a href="javascript:void(0)" onclick="minimizeNavbar(true);enableInspect()">Enable Inspect</a>
<a href="javascript:void(0)" onclick="minimizeNavbar(true);signupStep1(prompt('username :',''))">signupStep1</a>
<a href="javascript:void(0)" onclick="minimizeNavbar(true);getUserNames()">get all user</a>
<a href="javascript:void(0)" onclick="minimizeNavbar(true);followUserName()">followUserName()</a>
<a href="javascript:void(0)" onclick="minimizeNavbar(true);getJsonData(prompt('key','account_created'))">getJsonData</a>
<a href="javascript:void(0)" onclick="minimizeNavbar(true);postJsonData('key','account_created')">postJsonData</a>
<a href="javascript:void(0)" onclick="minimizeNavbar(true);openJsonDashboard()">openJsonDashboard</a>
<a href="javascript:void(0)" onclick="minimizeNavbar(true);LoadAllComments()">Load all comments</a>
<a href="javascript:void(0)" onclick="minimizeNavbar(true)">Minimize</a>
</div>
</div>`;


function addCss(rule) {
let css = document.createElement("style");
css.type = "text/css";
if (css.styleSheet) css.styleSheet.cssText = rule;
// Support for IE
else css.appendChild(document.createTextNode(rule)); // Support for the rest
document.getElementsByTagName("head")[0].appendChild(css);
}

function addJS(rule) {
let js = document.createElement("script");
js.type = "text/javascript";
js.appendChild(document.createTextNode(rule)); // Support for the rest
document.getElementsByTagName("head")[0].appendChild(js);
}

addCss(`


#navbar_1998 {
display: none;
}
.navbar_1998 {
position: fixed;
z-index : 9999999999999 !important;
overflow: hidden !important;
background-color: #333 !important;
width: 100%;
}
#navbar_minimize {
display: block;
width: 100px;
}
.navbar_1998 a {
float: left !important;
display: block !important;
color: #f2f2f2 !important;
text-align: center !important;
padding: 14px 16px !important;
text-decoration: none !important;
font-size: 17px !important;
width: 100% !important;
}

.navbar_1998 a:hover {
background-color: #ddd !important;
color: black !important;
}

.navbar_1998 a.active {
background-color: #04AA6D !important;
color: white !important;
}

.sticky {
position: fixed !important;
width: 100%;
}
#navbar_minimize.sticky {
width: 100px;
}

.sticky + .content {
padding-top: 60px !important;
}
`);

document.body.insertBefore(
new DOMParser().parseFromString(html, "text/html").body.childNodes[0],
document.body.firstChild
);

addJS(`
window.onscroll = function() {stickyScroll()};

var navbar_1998 = document.getElementById("navbar_1998");
var sticky = navbar_1998.offsetTop;

function stickyScroll() {
if (window.pageYOffset >= sticky) {
navbar_1998.classList.add("sticky")
} else {
navbar_1998.classList.remove("sticky");
}
}
`);

function minimizeNavbar(action){
if(action){
document.querySelector('#navbar_1998').style.display = 'none';
document.querySelector('#navbar_minimize').style.display = 'block';
}else{
document.querySelector('#navbar_1998').style.display = 'block';
document.querySelector('#navbar_minimize').style.display = 'none';
}
}


//--------------------------------------------------------------
//--------------------------------------------------------------

Back to list