Бесплатные скрипты приложений API

Did you know with Google Sheets you can create your own functions that pre-populate cells? Here's a code sample to show a true or false if a website is using a certain category of technology.





/**
* If the website has a technology in the group
*
* @param {domain} Root domain to lookup i.e. example.com
* @param {type} The type of technology i.e. 'shop' or 'cms'
* @param key Your API key at https://api.builtwith.com
* @return True if the technology has data
* @customfunction
*/
function BUILTWITHHASTECH(domain,type,key) {
var url = 'https://api.builtwith.com/free1/api.xml?KEY=' + key+ '&LOOKUP=' + domain;
var xml = UrlFetchApp.fetch(url).getContentText();
var document = XmlService.parse(xml);
var entries = document.getRootElement().getChildren('groups')[0].getChildren('group');
for (var i = 0; i < entries.length; i++) {
var title = entries[i].getChild('name').getText();
var live =entries[i].getChild('live').getText();

if ( title==type && parseInt(live)>0) {
return true;
}
}
return false;
}




This example serves as an example - we will provide other API endpoint App Scripts on request.

Google Таблицы
Устаревшая статья
Это устаревшая статья Базы знаний.
Создание отчетов
Специальные репортажи
Трубопровод