Skip to content

Instantly share code, notes, and snippets.

@NismoGraphics
Last active November 4, 2020 12:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NismoGraphics/38c829f96afa61f3089f1d82a8ec24c7 to your computer and use it in GitHub Desktop.
Save NismoGraphics/38c829f96afa61f3089f1d82a8ec24c7 to your computer and use it in GitHub Desktop.
Glitch Pinger
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);
@youngchief-btw
Copy link

const http = require('http');

function time() {
	var d = new Date();

	var datetext = d.toTimeString();

	datetext = datetext.split(' ')[0];

	return datetext;
};

function ping() {
http.get(`http://yourprojectnamehere.glitch.me`);
console.log(time()+" - Pinged!");
};

ping();

setInterval(ping, 280000);

This is a better way to do the pings

@youngchief-btw
Copy link

Also, note for everyone reading if you're using https replace any HTTP with HTTPS

@moneymikesscripting
Copy link

Doesn’t work for me....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment