Skip to content

Instantly share code, notes, and snippets.

View iTrauco's full-sized avatar

Christopher Trauco iTrauco

View GitHub Profile

Downloading Music Playlists from YouTube

Disclaimer

Use this knowledge at your own risk.

youtube-dl for Windows

youtube-dl will allow you to download entire youtube playlists and store them as MP3s. This will also allow you to download individual MP3s.

@iTrauco
iTrauco / df_to_gsheet.py
Created March 30, 2024 03:13 — forked from lucascheung/df_to_gsheet.py
Upload pandas dataframe Google Sheet
import json
from datetime import datetime
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from df2gspread import df2gspread as d2g
def upload_to_sheet(df,sheet_id, sheet_name):
scope = ['https://spreadsheets.google.com/feeds',
'https://www.googleapis.com/auth/drive']
credentials = ServiceAccountCredentials.from_json_keyfile_name('credentials.json', scope)
@iTrauco
iTrauco / sheet-and-gmail-sample.ipynb
Created January 26, 2023 02:25 — forked from honux77/sheet-and-gmail-sample.ipynb
Google spreadsheet and gmail sample (using python)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iTrauco
iTrauco / send_email.py
Created January 26, 2023 02:11 — forked from azmirfakkri/send_email.py
Email automation using Python and Google Sheet
# we need these modules to send the emails
import smtplib
import ssl
# these modules will allow you to create the client and interact
# with Google Sheet
import gspread
from oauth2client.service_account import ServiceAccountCredentials
# these modules will help you create the HTML emails
@iTrauco
iTrauco / submit.md
Created December 20, 2022 22:26 — forked from tanaikech/submit.md
Retrieving Spreadsheet ID from Range using Google Apps Script

Retrieving Spreadsheet ID from Range using Google Apps Script

This is a sample script for retrieving spreadsheet ID from a range using Google Apps Script. I sometimes want to retrieve spreadsheet ID from ranges. In such case, I always use this.

  • Range
  • -> Retrieve Sheet using getSheet()
  • -> Retrieve Spreadsheet using getParent()
  • -> Retrieve spreadsheet ID
@iTrauco
iTrauco / Code.gs
Created December 12, 2022 20:53 — forked from HoukasaurusRex/Code.gs
POST data to Google Sheets using Google Scripts
// Original: https://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
// Usage
// 1. Enter sheet name where data is to be written below
var sheetName = 'Users'
// 2. Run > setup
//
// 3. Publish > Deploy as web app
// - enter Project Version name and click 'Save New Version'
// - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously)
@iTrauco
iTrauco / addFormResponseIdAndUrl.gs
Created December 6, 2022 22:23 — forked from joshm21/addFormResponseIdAndUrl.gs
On Google Form submission, append the response id and edit response link to the Google Sheet row. Supports rapid form submissions. #google-apps-script #forms
function createFormTrigger() {
var triggerFunctionName = "addFormResponseIdAndUrl_";
deleteAllExistingTriggers_();
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
ScriptApp.newTrigger(triggerFunctionName)
.forSpreadsheet(spreadsheet)
.onFormSubmit()
.create();
}
@iTrauco
iTrauco / README.md
Created November 30, 2022 04:55 — forked from richardblondet/README.md
Create a simple API backend with Google App Script and a Spreadsheet

Google App Script CRUD

Inspired by this gist.

Getting Started

  1. Create a new App Script project.
  2. Paste the content of the file google-app-script-crud.gs in the default Code.gs file.
  3. Create a new Spreadsheet.
  4. Copy the Spreadsheet ID found in the URL into the variable SHEET_ID located in line 1 of your file.
@iTrauco
iTrauco / submit.md
Created November 23, 2022 22:23 — forked from tanaikech/submit.md
Creating Quizzes in Google Form using Google Forms API with Google Apps Script

Creating Quizzes in Google Form using Google Forms API with Google Apps Script

This is a sample script for creating quizzes in Google Form using Google Forms API with Google Apps Script. Recently, Google Forms API has been officially published, and it got to be able to be used by users. By this, quizzes in Google Form can be created using Google Forms API.

Here, there is one thing that can be achieved by Google Forms API. When Google Forms API is used, each choice in each question can be shuffled. This cannot be achieved with Google Forms Service (FormApp).

Usage