-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
41 lines (35 loc) · 934 Bytes
/
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
<!DOCTYPE html>
<html>
<head>
<title>Whatsapp API by Sara</title>
<meta http-equiv="refresh" content="300">
</head>
<body>
<div id="app">
<h1>Whatsapp API</h1>
<img src="" alt="QR Code" id="qrcode">
<h3>Logs:</h3>
<ul class="logs"></ul>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js" crossorigin="anonymous"></script>
<script>
$(document).ready(function() {
var socket = io();
socket.on('message', function(msg) {
$('.logs').append($('<li>').text(msg));
});
socket.on('qr', function(src) {
$('#qrcode').attr('src', src);
$('#qrcode').show();
});
socket.on('ready', function(data) {
$('#qrcode').hide();
});
socket.on('authenticated', function(data) {
$('#qrcode').hide();
});
});
</script>
</body>
</html>