Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function recalculateSheet() {
- var ss = SpreadsheetApp.openById("replaceWithSheetID");
- var sheet = ss.getSheetByName("weatherAPI");
- var timeCell = sheet.getRange('I1');
- var cell = sheet.getRange('C2:C90');
- var cellFormula2;
- var now = new Date();
- timeCell.setValue(now + " " + now.getHours() + ":" + now.getMinutes());
- cell.clearContent();
- SpreadsheetApp.flush();
- Utilities.sleep(2000);
- for(i=2;i<=90;i++){
- cellFormula2 = sheet.getRange('C'+[i]);
- cellFormula2.setValue('=ImportJSON(CONCATENATE("http://api.openweathermap.org/data/2.5/weather?q=",B'+[i]+',",uk&units=metric&appid=15eac9adb8223be2076251d4fb16f884"),"/main/temp","noInherit,noTruncate,noHeaders")');
- }
- }
Add Comment
Please, Sign In to add comment