Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //The URL you are checking for published status
- var url = URL;
- //The email you want to notify
- var email = EMAIL;
- function checkForPublish() {
- var scriptProperties = PropertiesService.getScriptProperties();
- if (scriptProperties.getProperty('PUBLISHED') == 'true') {
- Logger.log('ALREADY PUBLISHED');
- return;
- }
- var result=UrlFetchApp.fetch(url,{muteHttpExceptions: true});
- if (result.getResponseCode() == 200) {
- Logger.log('PUBLISHED');
- scriptProperties.setProperty('PUBLISHED', 'true');
- MailApp.sendEmail(email, "It's alive!", "The URL " + url + " has been published!");
- } else {
- Logger.log('NOT PUBLISHED');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement