This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function run() { | |
let sheet = SpreadsheetApp.openById(SPREADSHEET_ID).getSheetByName(SHEET_NAME); | |
let range = sheet.getDataRange() | |
let values = range.getValues(); | |
let header = values.shift() | |
let parameters = header.slice(1, header.length-1) | |
console.log(parameters) | |
let rows = []; | |
for (var row in values) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getMedadata_(url, parameters) { | |
const SYSTEM_INSTRUCTIONS = ` | |
You are expert in parsing information (string, number, array, etc) from website | |
Visit URL and parse listed parameters | |
Return as simple text JSON format WITHOUT markdown | |
Rules | |
1. Dont add \`\`\`json into result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gemini_(model, payload) { | |
const apiKey = PropertiesService.getScriptProperties().getProperty('GEMINI_API_KEY'); | |
const api = 'generateContent'; | |
const url = `https://generativelanguage.googleapis.com/v1beta/models/${model}:${api}?key=${apiKey}`; | |
const options = { | |
method: 'POST', | |
contentType: 'application/json', | |
muteHttpExceptions: true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function start() { | |
const REGION = "us-central1"; | |
const GCP_PROJECT_ID = "gcp-kutil"; | |
const task = ` | |
- Create a new label 'DEMO' in Gmail | |
- create only if it did not exist. | |
- Load last 10 emails with subject 'Security alert'. | |
- SET this new label 'DEMO' to found emails |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Agent() { | |
const ticks = "```"; | |
this.person = ` | |
Person | |
- You are Google Apps Script expert developer, who is able to generate valid code for V8 runtime | |
- Your goal is to create code for defined task | |
- Return only code in markdown between ${ticks}javascript and ${ticks} | |
- Return all code in one big function named main(). | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"timeZone": "Europe/Prague", | |
"exceptionLogging": "STACKDRIVER", | |
"runtimeVersion": "V8", | |
"oauthScopes": [ | |
"https://www.googleapis.com/auth/cloud-platform", | |
"https://www.googleapis.com/auth/script.external_request", | |
"https://mail.google.com/", | |
"https://www.googleapis.com/auth/drive", | |
"https://www.googleapis.com/auth/spreadsheets", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Get filtered rows from Google Sheets | |
@author Ivan Kutil | |
Preparation: add Advanced service "Sheets" into Google Apps Script project | |
*/ | |
function getFilteredRows() { | |
console.time("filtered-rows") | |
let spreadsheetId = SpreadsheetApp.getActive().getId(); | |
let sheetName = "MySheetName" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Apps Script code snippet based on GCPping.com | |
@author Ivan Kutil | |
*/ | |
var URLS = { | |
"asia-east1": "http://104.155.201.52/ping", | |
"asia-east2": "http://35.220.162.209/ping", | |
"asia-northeast1": "http://104.198.86.148/ping", | |
"asia-south1": "http://35.200.186.152/ping", | |
"asia-southeast1": "http://35.185.179.198/ping", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doGet(e) { | |
return HtmlService.createTemplateFromFile("view").evaluate(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SPREADSHEET_ID = "xxxxx"; // <-- Google Spreadsheet ID | |
var settings = { | |
nomadland : "xxxxxx" // <--- subtitles fileId | |
} | |
function RUN() { | |
var movie = "nomadland" | |
var fileId = settings[movie]; | |
var output = subitlesParser(fileId); |
NewerOlder