-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
140 lines (136 loc) · 3.75 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!-- Creado por adamff24 -->
<html>
<head>
<title>Steam to HEX</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>
p {
display: inline-block;
vertical-align: middle;
margin: 10px 2px 2px;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
textarea {
resize: none;
}
div {
border-radius: 10px;
background-color: #f2f2f2;
padding: 20px;
margin: 0px 0px 22px 0px;
display:inline-block;
}
.top {
display: flex;
align-items: center;
}
.button {
border: none;
color: white;
padding: 10px 16px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 10px 2px 2px;
transition-duration: 0.4s;
cursor: pointer;
float: right;
}
.button1 {
background-color: white;
color: black;
border: 2px solid #1a237e;
}
.button2 {
background-color: white;
color: black;
border: 2px solid #5c6bc0;
}
.button3 {
background-color: white;
color: black;
border: 2px solid #9fa8da;
width: 100px;
}
.button1:hover {
background-color: #1a237e;
color: white;
}
.button2:hover {
background-color: #5c6bc0;
color: white;
}
.button3:hover {
background-color: #9fa8da;
color: white;
}
</style>
</head>
<body>
<script>
function calcular() {
document.getElementById("out").value = ""
document.getElementById("out").value += "INSERT INTO whitelist(identifier)\nVALUES\n"
var textArea = document.getElementById("in");
var arrayOfLines = textArea.value.split("\n");
var numberOfProfiles = textArea.value.split("profiles");
let count = 0;
for(var i = 0;i < arrayOfLines.length;i++){
if (arrayOfLines[i].includes("profiles/")) {
count++;
var string = BigInt(arrayOfLines[i].split("profiles/")[1].split("/")[0].split(" ")[0]).toString(16).toUpperCase();
if (count == numberOfProfiles.length - 1) {
var lastCharacter = ";";
} else {
var lastCharacter = ",\n";
}
document.getElementById("out").value += " (\"steam:" + string + "\")" + lastCharacter;
}
}
}
function download(){
var text = document.getElementById("out").value;
text = text.replace(/\n/g, "\r\n"); // To retain the Line breaks.
var blob = new Blob([text], { type: "text/plain"});
var anchor = document.createElement("a");
anchor.download = "hex" + getFormattedTime() + ".sql";
anchor.href = window.URL.createObjectURL(blob);
anchor.target ="_blank";
anchor.style.display = "none";
document.body.appendChild(anchor);
anchor.click();
document.body.removeChild(anchor);
}
function clipboard() {
var copyText = document.getElementById("out");
copyText.select();
document.execCommand("copy");
}
function getFormattedTime() {
var today = new Date();
var y = today.getFullYear();
var m = today.getMonth() + 1;
var d = today.getDate();
var h = today.getHours();
var mi = today.getMinutes();
var s = today.getSeconds();
return "_" + d + "-" + m + "-" + y + "_" + h + "." + mi + "." + s;
}
</script>
<center>
<div>
<h1>Steam profiles to HEX</h1>
<textarea autofocus rows="30" cols="60" placeholder="Introduce aquí las URLs (una por línea)..." id="in"></textarea>
<form onsubmit='#' style='display:inline;' action="post.php" method="post">
<textarea readonly rows="30" cols="40" name="out" id="out"></textarea></br>
</form>
<button id="calcular" class="button button1" onclick="calcular()">Convertir</button>
<button id="download" class="button button2" onclick="download()">Descargar</button>
<button id="clipboard" class="button button3" onclick="clipboard()">Copiar</button>
</div>
</center>
</body>
</html>