Skip to content

Instantly share code, notes, and snippets.

View SourcingDenis's full-sized avatar
🔎
Sourcing for Talent

Denys Dinkevych SourcingDenis

🔎
Sourcing for Talent
View GitHub Profile
function getGitHubRepoUrl() {
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getActiveRange();
var username = range.getValue();
var adjacentCell = range.offset(0, 1); // adjust this if the URL is in a different column
var repoUrl = "";
if (username.indexOf("github.com") >= 0) {
username = username.replace(/^.*com[/]([^/]*).*$/,'$1');
}
var API_KEY = 'YOUR_API_KEY';
function runGPT() {
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getRange('A1:B1').getValues();
var cell1 = range[0][0];
var cell2 = range[0][1];
var prompt = cell1 + ' space ' + cell2;
var API_URL = 'https://api.openai.com/v1/completions';