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 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 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) { |
OlderNewer