Last active
November 4, 2020 12:33
-
-
Save NismoGraphics/38c829f96afa61f3089f1d82a8ec24c7 to your computer and use it in GitHub Desktop.
Glitch Pinger
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
const http = require('http'); | |
function time() { | |
var d = new Date(); | |
var datetext = d.toTimeString(); | |
datetext = datetext.split(' ')[0]; | |
return datetext; | |
}; | |
http.get(`http://yourprojectnamehere.glitch.me`); | |
console.log(time()+" - Pinged!"); | |
setInterval(() => { | |
http.get(`http://yourprojectnamehere.glitch.me`); | |
console.log(time()+" - Pinged!"); | |
}, 280000); |
Also, note for everyone reading if you're using https replace any HTTP with HTTPS
Doesn’t work for me....
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a better way to do the pings