Spaces:
Sleeping
Sleeping
DmitrMakeev
commited on
Commit
•
acf4a1d
1
Parent(s):
5518a4c
Update ver.html
Browse files
ver.html
CHANGED
@@ -35,17 +35,20 @@
|
|
35 |
line-height: 30px;
|
36 |
color: white;
|
37 |
}
|
38 |
-
#fileInput, #verifyButton {
|
39 |
margin-top: 20px;
|
40 |
-
padding: 10px
|
41 |
font-size: 16px;
|
|
|
|
|
|
|
|
|
42 |
color: white;
|
43 |
background-color: #4CAF50;
|
44 |
border: none;
|
45 |
cursor: pointer;
|
46 |
-
border-radius: 5px;
|
47 |
}
|
48 |
-
#verifyButton:hover
|
49 |
background-color: #388E3C;
|
50 |
}
|
51 |
#downloadLink {
|
@@ -64,18 +67,25 @@
|
|
64 |
</style>
|
65 |
</head>
|
66 |
<body>
|
67 |
-
<h1
|
|
|
68 |
<div id="progressBarContainer">
|
69 |
<div id="progressBar">
|
70 |
<div id="progress">0%</div>
|
71 |
</div>
|
72 |
</div>
|
73 |
<input type="file" id="fileInput" accept=".txt">
|
74 |
-
<button id="verifyButton"
|
75 |
-
<a id="downloadLink" style="display: none;"
|
76 |
|
77 |
<script>
|
78 |
document.getElementById('verifyButton').addEventListener('click', function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
const fileInput = document.getElementById('fileInput');
|
80 |
const file = fileInput.files[0];
|
81 |
if (!file) {
|
@@ -87,12 +97,12 @@
|
|
87 |
reader.onload = function(event) {
|
88 |
const text = event.target.result;
|
89 |
const phones = text.split('\n').map(phone => phone.trim()).filter(phone => phone);
|
90 |
-
verifyPhones(phones, 1000); // 1000 миллисекунд (1 секунда) задержка
|
91 |
};
|
92 |
reader.readAsText(file);
|
93 |
});
|
94 |
|
95 |
-
async function verifyPhones(phones, delay) {
|
96 |
const totalPhones = phones.length;
|
97 |
const progressBar = document.getElementById('progress');
|
98 |
const progressText = document.getElementById('progress').textContent;
|
@@ -101,7 +111,7 @@
|
|
101 |
for (let i = 0; i < totalPhones; i++) {
|
102 |
const phone = phones[i];
|
103 |
try {
|
104 |
-
const response = await fetch(
|
105 |
method: 'POST',
|
106 |
headers: {
|
107 |
'Content-Type': 'application/json'
|
|
|
35 |
line-height: 30px;
|
36 |
color: white;
|
37 |
}
|
38 |
+
#apiKeyInput, #fileInput, #verifyButton {
|
39 |
margin-top: 20px;
|
40 |
+
padding: 10px;
|
41 |
font-size: 16px;
|
42 |
+
border: 1px solid #ccc;
|
43 |
+
border-radius: 5px;
|
44 |
+
}
|
45 |
+
#verifyButton {
|
46 |
color: white;
|
47 |
background-color: #4CAF50;
|
48 |
border: none;
|
49 |
cursor: pointer;
|
|
|
50 |
}
|
51 |
+
#verifyButton:hover {
|
52 |
background-color: #388E3C;
|
53 |
}
|
54 |
#downloadLink {
|
|
|
67 |
</style>
|
68 |
</head>
|
69 |
<body>
|
70 |
+
<h1>Phone Verification</h1>
|
71 |
+
<input type="text" id="apiKeyInput" placeholder="Enter API Key">
|
72 |
<div id="progressBarContainer">
|
73 |
<div id="progressBar">
|
74 |
<div id="progress">0%</div>
|
75 |
</div>
|
76 |
</div>
|
77 |
<input type="file" id="fileInput" accept=".txt">
|
78 |
+
<button id="verifyButton">Verify Phones</button>
|
79 |
+
<a id="downloadLink" style="display: none;">Download Verified Phones</a>
|
80 |
|
81 |
<script>
|
82 |
document.getElementById('verifyButton').addEventListener('click', function() {
|
83 |
+
const apiKey = document.getElementById('apiKeyInput').value;
|
84 |
+
if (!apiKey) {
|
85 |
+
alert('Please enter your API key.');
|
86 |
+
return;
|
87 |
+
}
|
88 |
+
|
89 |
const fileInput = document.getElementById('fileInput');
|
90 |
const file = fileInput.files[0];
|
91 |
if (!file) {
|
|
|
97 |
reader.onload = function(event) {
|
98 |
const text = event.target.result;
|
99 |
const phones = text.split('\n').map(phone => phone.trim()).filter(phone => phone);
|
100 |
+
verifyPhones(phones, apiKey, 1000); // 1000 миллисекунд (1 секунда) задержка
|
101 |
};
|
102 |
reader.readAsText(file);
|
103 |
});
|
104 |
|
105 |
+
async function verifyPhones(phones, apiKey, delay) {
|
106 |
const totalPhones = phones.length;
|
107 |
const progressBar = document.getElementById('progress');
|
108 |
const progressText = document.getElementById('progress').textContent;
|
|
|
111 |
for (let i = 0; i < totalPhones; i++) {
|
112 |
const phone = phones[i];
|
113 |
try {
|
114 |
+
const response = await fetch(`https://api.green-api.com/waInstance1101952913/checkWhatsapp/${apiKey}`, {
|
115 |
method: 'POST',
|
116 |
headers: {
|
117 |
'Content-Type': 'application/json'
|