=IFERROR(IMPORTXML("https://www.youtube.com/watch?v=EJVSx6CUFFc";
"(//*[contains(@class,'like-button-renderer-like-button')])[1]");0)
=IF(
ISNA(IMPORTXML("https://www.youtube.com/watch?v=EJVSx6CUFFc";
"(//*[contains(@class,'like-button-renderer-like-button')])[1]"));
0;
IMPORTXML("https://www.youtube.com/watch?v=EJVSx6CUFFc";
"(//*[contains(@class,'like-button-renderer-like-button')])[1]")
)
> new String('Hello world!') == 'Hello world!'
<· true
> new String('Hello world!') === 'Hello world!'
<· false
/**
* @param {GoogleAppsScript.Spreadsheet.Sheet} sheet Лист Таблицы
* @param {number} column Номер столбца
* @param {number} [startRow] Пропускает количество строк сначала
* @param {number} [numColums] Количество возвращаемых колонок
* @returns {Object[][]} Массив значений
* @see {@link https://toster.ru/q/549725}
*/
var getValuesFromColumn = function(sheet, column, startRow, numColums) {
startRow = startRow || 1;
numColums = numColums || 1;
var lastRow = sheet.getLastRow();
return sheet
.getRange(startRow, column, lastRow - startRow + 1, numColums)
.getValues();
};
var arr = getValuesFromColumn(mainSheet, 3, 3, 2);
from __future__ import print_function
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
from qs import CreateMessage, SendMessage
SCOPES = 'https://www.googleapis.com/auth/gmail.send'
def main():
"""Shows basic usage of the Gmail API.
Lists the user's Gmail labels.
"""
store = file.Storage('token.json')
creds = store.get()
if not creds or creds.invalid:
flow = client.flow_from_clientsecrets('credentials.json', SCOPES)
creds = tools.run_flow(flow, store)
service = build('gmail', 'v1', http=creds.authorize(Http()))
message = CreateMessage('xxx@gmail.com',
'yyy@inbox.ru',
'test',
'https://docs.google.com/spreadsheets/d/xxx/edit?usp=sharing')
SendMessage(service, 'me', message=message)
if __name__ == '__main__':
main()
/**
* Get an array of all LinkUrls in the document. The function is
* recursive, and if no element is provided, it will default to
* the active document's Body element.
*
* @param {Element} element The document element to operate on.
* .
* @returns {Array} Array of objects, vis
* {element,
* startOffset,
* endOffsetInclusive,
* url}
*/
function getAllLinks(element) {
var links = [];
element = element || DocumentApp.getActiveDocument().getBody();
if (element.getType() === DocumentApp.ElementType.TEXT) {
var textObj = element.editAsText();
var text = element.getText();
var inUrl = false;
for (var ch=0; ch < text.length; ch++) {
var url = textObj.getLinkUrl(ch);
if (url != null) {
if (!inUrl) {
// We are now!
inUrl = true;
var curUrl = {};
curUrl.element = element;
curUrl.url = String( url ); // grab a copy
curUrl.startOffset = ch;
}
else {
curUrl.endOffsetInclusive = ch;
}
}
else {
if (inUrl) {
// Not any more, we're not.
inUrl = false;
links.push(curUrl); // add to links
curUrl = {};
}
}
}
}
else {
var numChildren = element.getNumChildren();
for (var i=0; i<numChildren; i++) {
links = links.concat(getAllLinks(element.getChild(i)));
}
}
return links;
}
if (continuationToken == null) {
var files = DriveApp.getFiles();
} else {
var files = DriveApp.continueFileIterator(continuationToken);
}
где continuationToken заранее получен и извлечен из внешнего хранилища.
if(files.hasNext()){
var continuationToken = files.getContinuationToken();