DmitrMakeev commited on
Commit
7b9983c
1 Parent(s): 5fa984e

Create ver.html

Browse files
Files changed (1) hide show
  1. ver.html +69 -0
ver.html ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Phone Verification</title>
7
+ </head>
8
+ <body>
9
+ <input type="file" id="fileInput" accept=".txt">
10
+ <button id="verifyButton">Verify Phones</button>
11
+ <a id="downloadLink" style="display: none;">Download Verified Phones</a>
12
+
13
+ <script>
14
+ document.getElementById('verifyButton').addEventListener('click', function() {
15
+ const fileInput = document.getElementById('fileInput');
16
+ const file = fileInput.files[0];
17
+ if (!file) {
18
+ alert('Please select a file.');
19
+ return;
20
+ }
21
+
22
+ const reader = new FileReader();
23
+ reader.onload = function(event) {
24
+ const text = event.target.result;
25
+ const phones = text.split('\n').map(phone => phone.trim()).filter(phone => phone);
26
+ verifyPhones(phones, 1000); // 1000 миллисекунд (1 секунда) задержка
27
+ };
28
+ reader.readAsText(file);
29
+ });
30
+
31
+ async function verifyPhones(phones, delay) {
32
+ const verifiedPhones = [];
33
+ for (let i = 0; i < phones.length; i++) {
34
+ const phone = phones[i];
35
+ try {
36
+ const response = await fetch('https://api.green-api.com/waInstance1101952913/checkWhatsapp/fb4986a9d9cb40ef9be6c7b08cb9c98b7a3b1dc8c6834b0b92', {
37
+ method: 'POST',
38
+ headers: {
39
+ 'Content-Type': 'application/json'
40
+ },
41
+ body: JSON.stringify({ phoneNumber: phone })
42
+ });
43
+ const data = await response.json();
44
+ if (data.existsWhatsapp) {
45
+ console.log(`Phone ${phone} exists in WhatsApp.`);
46
+ verifiedPhones.push(phone);
47
+ } else {
48
+ console.log(`Phone ${phone} does not exist in WhatsApp.`);
49
+ }
50
+ } catch (error) {
51
+ console.error(`Error verifying phone ${phone}:`, error);
52
+ }
53
+
54
+ if (i < phones.length - 1) {
55
+ await new Promise(resolve => setTimeout(resolve, delay));
56
+ }
57
+ }
58
+
59
+ const verifiedText = verifiedPhones.join('\n');
60
+ const blob = new Blob([verifiedText], { type: 'text/plain' });
61
+ const url = URL.createObjectURL(blob);
62
+ const downloadLink = document.getElementById('downloadLink');
63
+ downloadLink.href = url;
64
+ downloadLink.download = 'verified_phones.txt';
65
+ downloadLink.style.display = 'block';
66
+ }
67
+ </script>
68
+ </body>
69
+ </html>