DmitrMakeev commited on
Commit
dbb6a39
1 Parent(s): e16ded1

Create ver2.html

Browse files
Files changed (1) hide show
  1. ver2.html +94 -0
ver2.html ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <style>
8
+ #progressBar {
9
+ width: 100%;
10
+ background-color: #ddd;
11
+ }
12
+ #progress {
13
+ width: 0%;
14
+ height: 30px;
15
+ background-color: #4CAF50;
16
+ text-align: center;
17
+ line-height: 30px;
18
+ color: white;
19
+ }
20
+ </style>
21
+ </head>
22
+ <body>
23
+ <input type="file" id="fileInput" accept=".txt">
24
+ <button id="verifyButton">Verify Phones</button>
25
+ <a id="downloadLink" style="display: none;">Download Verified Phones</a>
26
+ <div id="progressBar">
27
+ <div id="progress">0%</div>
28
+ </div>
29
+
30
+ <script>
31
+ document.getElementById('verifyButton').addEventListener('click', function() {
32
+ const fileInput = document.getElementById('fileInput');
33
+ const file = fileInput.files[0];
34
+ if (!file) {
35
+ alert('Please select a file.');
36
+ return;
37
+ }
38
+
39
+ const reader = new FileReader();
40
+ reader.onload = function(event) {
41
+ const text = event.target.result;
42
+ const phones = text.split('\n').map(phone => phone.trim()).filter(phone => phone);
43
+ verifyPhones(phones, 1000); // 1000 миллисекунд (1 секунда) задержка
44
+ };
45
+ reader.readAsText(file);
46
+ });
47
+
48
+ async function verifyPhones(phones, delay) {
49
+ const totalPhones = phones.length;
50
+ const progressBar = document.getElementById('progress');
51
+ const progressText = document.getElementById('progress').textContent;
52
+ const verifiedPhones = [];
53
+
54
+ for (let i = 0; i < totalPhones; i++) {
55
+ const phone = phones[i];
56
+ try {
57
+ const response = await fetch('https://api.green-api.com/waInstance1101952913/checkWhatsapp/fb4986a9d9cb40ef9be6c7b08cb9c98b7a3b1dc8c6834b0b92', {
58
+ method: 'POST',
59
+ headers: {
60
+ 'Content-Type': 'application/json'
61
+ },
62
+ body: JSON.stringify({ phoneNumber: phone })
63
+ });
64
+ const data = await response.json();
65
+ if (data.existsWhatsapp) {
66
+ console.log(`Phone ${phone} exists in WhatsApp.`);
67
+ verifiedPhones.push(phone);
68
+ } else {
69
+ console.log(`Phone ${phone} does not exist in WhatsApp.`);
70
+ }
71
+ } catch (error) {
72
+ console.error(`Error verifying phone ${phone}:`, error);
73
+ }
74
+
75
+ const progress = ((i + 1) / totalPhones) * 100;
76
+ progressBar.style.width = `${progress}%`;
77
+ progressBar.textContent = `${progress.toFixed(2)}%`;
78
+
79
+ if (i < totalPhones - 1) {
80
+ await new Promise(resolve => setTimeout(resolve, delay));
81
+ }
82
+ }
83
+
84
+ const verifiedText = verifiedPhones.join('\n');
85
+ const blob = new Blob([verifiedText], { type: 'text/plain' });
86
+ const url = URL.createObjectURL(blob);
87
+ const downloadLink = document.getElementById('downloadLink');
88
+ downloadLink.href = url;
89
+ downloadLink.download = 'verified_phones.txt';
90
+ downloadLink.style.display = 'block';
91
+ }
92
+ </script>
93
+ </body>
94
+ </html>