Netatmo API Had Been Down 2
Report
Netatmo API had been down from Aug. 8, 2017 21:30 JST to Aug. 9, 2017 17:30 JST. Now it’s working.
I got an e-mail from Netatmo. They say that the issue was solved.
Netatmo API had been down from Aug. 8, 2017 21:30 JST to Aug. 9, 2017 17:30 JST. Now it’s working.
I got an e-mail from Netatmo. They say that the issue was solved.
Netatmo API had been down from Aug. 7, 2017 00:00 a.m. JST to Aug. 7, 2017 07:30 a.m. JST. Now it’s working.
When the shared files on Google Drive is downloaded, it is necessary to change the download method by the file size. The boundary of file size when the method is changed is about 40MB.
filename="### filename ###"
fileid="### file ID ###"
curl -L -o ${filename} "https://drive.google.com/uc?export=download&id=${fileid}"
When it tries to download the file with more than 40MB, Google says to download from following URL.
This GAS sample is for retrieving access token to use OneDrive APIs using Google Apps Script.
In this script, the authorization code is automatically retrieved.
In order to use this, both accounts of Google and OneDrive (MSN) are required.
https://script.google.com/macros/s/###/dev. So please modify this URL. Replace from “dev” to “usercallback” for the URL. And copy this modified URL.
https://script.google.com/macros/s/###/devhttps://script.google.com/macros/s/###/usercallbackhttps://script.google.com/macros/s/###/usercallbackBy above operation, the preparation is done.
When it uses Google Sheets API v4, GridRange is used for it as the range property. These sample scripts are for converting from a1Notation to GridRange. You can chose from following 2 scripts. Both scripts can retrieve the same result.
This is from me.
function a1notation2gridrange1(sheetid, a1notation) {
var data = a1notation.match(/(^.+)!(.+):(.+$)/);
var ss = SpreadsheetApp.openById(sheetid).getSheetByName(data[1]);
var range = ss.getRange(data[2] + ":" + data[3]);
var gridRange = {
sheetId: ss.getSheetId(),
startRowIndex: range.getRow() - 1,
endRowIndex: range.getRow() - 1 + range.getNumRows(),
startColumnIndex: range.getColumn() - 1,
endColumnIndex: range.getColumn() - 1 + range.getNumColumns(),
};
if (!data[2].match(/[0-9]/)) delete gridRange.startRowIndex;
if (!data[3].match(/[0-9]/)) delete gridRange.endRowIndex;
return gridRange;
}
String.prototype.to10 was used for this script. String.prototype.to10 is from Alexander Ivanov. I think that String.prototype.to10 is a clever solution.
Here, I introduce 2 scripts for uploading files to Slack using Node.js as samples. These 2 sample scripts are for uploading files to Slack.
form-data.boundary using Buffer.concat().These sample scripts are for requesting multipart post using Google Apps Script.
In most cases, the multipart request is used for uploading files. So I prepared 2 sample situations as follows. For each situation, the request parameters are different.
Multipart post is required for these situations.
In order to use this sample, please retrieve access token for uploading file to Slack.
This is a sample script for retrieving images on Spreadsheet.
Unfortunately, there are no methods for retrieving directly images on spreadsheet using GAS. So I use the method which retrieves URL from =image(URL) and retrieves the image from the URL.
In this case, =image(URL) has to be in the cell. Images embedded by insertImage() cannot be retrieved.
At first, please confirm them.
var cell = "A1"; // Cell address with the function of "=image()"
var filename = "samplename"; // Output filename
var image = SpreadsheetApp.getActiveSheet().getRange(cell).getFormula();
var blob = UrlFetchApp.fetch(image.match(/\"(.+)\"/)[1]).getBlob();
DriveApp.createFile(blob.setName(filename));
=image(URL) using getFormula().=image(URL).UrlFetchApp.fetch() from the URL.This sample is for retrieving array coordinates of duplicated elements.
var inputdata = ["a", "b", "b", "c", "d", "c", "e", "a", "f", "g"];
var dic = {};
var result = [];
inputdata.forEach(function(e, i){
if (dic[e]) {
result[i] = 'Duplicated';
} else {
result[i] = null;
}
dic[e] = "temp";
});
Logger.log(JSON.stringify(result))
Logger.log([i for (i in result) if(result[i]=='Duplicated')])
[null,null,"Duplicated",null,null,"Duplicated",null,"Duplicated",null,null]
[2, 5, 7]
This is a sample of Google Apps Script. This script is for retrieving all files and folders under a folder on Google Drive. All files and folders in the specific folder can be retrieved.
If you want to retrieve file list with all files and folders on Google Drive, please use DriveApp.getRootFolder().getId() as folderId.
When there are a lot of files in the folder, it may be over the limitation time to execute script.