Shared publicly  - 
 
My web host has a 99.9% uptime guarantee and I get account credit if it falls below that. Unfortunately I have to apply each month to get the credit if its due. So I don't forget I made a Google Sheet/Apps Script which uses importHTML to grab the server uptime table http://www.site5.com/support/uptime/s2-london/ then MailApp to email me if credit is due (unfortunately I need to submit credit request via their ticket system otherwise it would all be completely automated). The code I use is

// add Resource > Current script's trigger to add refundDue as a week timer
function refundDue() {
  var doc = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = doc.getSheetByName("Sheet1");
  var uptime = sheet.getRange("c3").getValue();
  var date = new Date().getDate();
  var emailAdd = "youremailaddress@gmail.com";
  if (date <= 7){
    if (typeof uptime == "number" && uptime < 0.999){
      MailApp.sendEmail(emailAdd, "Uptime refund due", "Uptime recorded as "+uptime+" http://www.site5.com/support/uptime/s2-london/ \n\nRequest refund https://backstage.site5.com/client/helpdesk/list/");
    } else {
      MailApp.sendEmail(emailAdd, "Failed: Uptime refund due");
    }
  }
}

#googleappsscript  
1
Add a comment...