Use this knowledge at your own risk.
youtube-dl will allow you to download entire youtube playlists and store them as MP3s. This will also allow you to download individual MP3s.
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) |
# 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 |
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.
getSheet()
getParent()
// 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) |
function createFormTrigger() { | |
var triggerFunctionName = "addFormResponseIdAndUrl_"; | |
deleteAllExistingTriggers_(); | |
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); | |
ScriptApp.newTrigger(triggerFunctionName) | |
.forSpreadsheet(spreadsheet) | |
.onFormSubmit() | |
.create(); | |
} |
Inspired by this gist.
google-app-script-crud.gs
in the default Code.gs
file.SHEET_ID
located in line 1 of your file.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).