Skip to content

Instantly share code, notes, and snippets.

View CodyReeves's full-sized avatar
😎
Crushing work; Making things happen

Cody Reeves CodyReeves

😎
Crushing work; Making things happen
View GitHub Profile
@CodyReeves
CodyReeves / gong-call-data-fetch.gs
Last active September 14, 2024 21:09
Gong.io API Data Fetch. Gathers the calls from current day and save the transcript separated by speaker. Call Meta will also be fetched via a separate call. Saves all data to Sheets.
/**
* Fetch transcripts using Basic Authentication
*/
function fetchTranscripts() {
var yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
var fromDateTime = Utilities.formatDate(yesterday, 'GMT', "yyyy-MM-dd'T'00:00:00'Z'");
var toDateTime = Utilities.formatDate(yesterday, 'GMT', "yyyy-MM-dd'T'23:59:59'Z'");
var url = 'https://api.gong.io/v2/calls/transcript';
@CodyReeves
CodyReeves / combined-sheets.js
Created July 2, 2024 04:51
App Script to combined a list of sheets into one single sheet data.
function combineSheets() {
var sheetNames = [
"data", "1-data"
];
var sApp = SpreadsheetApp.getActiveSpreadsheet();
sheetNames.forEach(function(sheetName) {
var combinedData = [];
var sheet = sApp.getSheetByName(sheetName);
if (sheet) {
@CodyReeves
CodyReeves / app-script-clear-sheet.js
Created July 2, 2024 04:47
Clear Spreadsheet of all data
///
// Clear Spreadsheet of all data
///
function clearSheet(sheet) {
var lastRow = sheet.getLastRow();
var lastColumn = sheet.getLastColumn();
if (lastRow > 1) {
sheet.getRange(2, 1, lastRow - 1, lastColumn).clearContent();
}
//////////////////////////////////////////////
// Base Data Fetches for the Google Sheet. //
////////////////////////////////////////////
///
// Clear Spreadsheet of all data
///
function clearSheet(sheet) {
var lastRow = sheet.getLastRow();
var lastColumn = sheet.getLastColumn();
@CodyReeves
CodyReeves / fetch-gong-transcripts.js
Created July 2, 2024 04:39
App script to fetch Gong transcripts and add to a Sheet
/**
* Fetch transcripts using Basic Authentication
*/
function fetchTranscripts() {
var yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 5);
var fromDateTime = Utilities.formatDate(yesterday, 'GMT', "yyyy-MM-dd'T'00:00:00'Z'");
var toDateTime = Utilities.formatDate(yesterday, 'GMT', "yyyy-MM-dd'T'23:59:59'Z'");
var url = 'https://api.gong.io/v2/calls/transcript';
// https://developers.hubspot.com/docs/api/conversations/conversations
function stripHtml(htmlString) {
if(htmlString) {
// This regular expression finds HTML tags and removes them
return htmlString.replace(/<[^>]*>/g, '');
} else {
return;
}
}
@CodyReeves
CodyReeves / fetch-hubspot-messages.js
Created July 2, 2024 04:34
Fetch Hubspot Messages App Script.
function clearSheet(sheetName) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName);
sheet.clear(); // Clears the entire sheet
}
function stripHtml(htmlString) {
if(htmlString) {
// This regular expression finds HTML tags and removes them
return htmlString.replace(/<[^>]*>/g, '');
} else {
@CodyReeves
CodyReeves / export-to-txt.js
Created July 2, 2024 04:32
App Script to export all sheets to a txt files to google drive.
function exportAllSheetsToTxtExceptSkipped() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheets = ss.getSheets(); // Get all sheets in the spreadsheet
sheets.forEach(sheet => {
const sheetName = sheet.getName();
// Skip sheets with specific keywords in their names
const skipKeywords = ["Instructions", "Triggers", "Raw"];
const shouldSkip = skipKeywords.some(keyword => sheetName.includes(keyword));
@CodyReeves
CodyReeves / task-update-difference.js
Last active July 2, 2024 04:28
Calculate time difference between Jira Issues
function processTasks() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const historySheet = ss.getSheetByName("History");
const slackSheet = ss.getSheetByName("Slack");
const sheet = ss.getSheetByName("Jira Work Today Tickets");
const data = sheet.getDataRange().getValues();
const headers = data.shift();
const assigneeIndex = headers.indexOf('Assignee');
const updatedIndex = headers.indexOf('Updated');
@CodyReeves
CodyReeves / Interesting Link: Book Recommendation! “ Just Work: Get Sh*t Done, Fast & Fair” by Kim Scott.md
Created April 6, 2021 16:35
Cody Reeves found an intresting link: Book Recommendation! “ Just Work: Get Sh*t Done, Fast & Fair” by Kim Scott