Skip to content

Instantly share code, notes, and snippets.

@rounakdatta
Created March 30, 2019 05:41
Show Gist options
  • Save rounakdatta/d993016550ce100205ea16e77fe95dae to your computer and use it in GitHub Desktop.
Save rounakdatta/d993016550ce100205ea16e77fe95dae to your computer and use it in GitHub Desktop.
Keep hypersomniac sites awake
function keepMyServerAlive() {
var allMySites = ['https://google.com'];
for (var siteIndex in allMySites) {
var currentSite = allMySites[siteIndex];
try {
var response = UrlFetchApp.fetch(currentSite);
Logger.log(response.getContentText());
} catch(e) {
Logger.log(e);
}
}
}
@rounakdatta
Copy link
Author

Setting this up at https://script.google.com to be triggered in intervals of 10 mins must help!

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