Back to APIs list

Google Drive API examples & templates

Use these vals as a playground to view and fork Google Drive API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
stevekrouse avatar
dateMeDocs
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
stevekrouse avatar
Jumpchain_Website
@stevekrouse
HTTP
Forked from willthereader/Jumpchain_Website
willthereader avatar
Jumpchain_Website
@willthereader
HTTP
Forked from willthereader/homepage
all avatar
townGen
@all
HTTP (preview)
townGen [[https://www.val.town/v/all/promptGen]] [[https://www.val.town/v/stevekrouse/valwriter]] Note : It looks like openai enhancement was dropped at some point when adding all the gizmos;
elsif_maj avatar
topHNThreadByHour
@elsif_maj
Email
// set at Thu Nov 30 2023 14:22:53 GMT+0000 (Coordinated Universal Time)
stevekrouse avatar
date_me_docs_cache
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
cofsana avatar
townGen
@cofsana
HTTP (preview)
Forked from all/townGen
ajax avatar
resume
@ajax
Script
// set by ajax.resumeHtml at 2023-06-07T20:30:59.005Z
ajax avatar
resumeConfig
@ajax
Script
Forked from iamseeley/resumeConfig
mattx avatar
gsheet_call
@mattx
Script
gsheet_call Wrapper around Google Sheets API v4. Parameters service_account: JSON string containing Google Service Account key sheet_id: Google Sheet ID method: HTTP method to use action: Full URL with https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/ removed data: HTTP request body Requirements a Google Cloud service account the Google Sheets API v4 enabled in your Google Cloud project the spreadsheet ID (provide it in the sheet_id parameter) Instructions Share the spreadsheet with the service account Make a JSON key for the service account, then set it as a secret. Use the secret for the service_account parameter. Figure out the action you want to perform. You will need to provide everything that comes after {spreadsheetId}/ as the action parameter. For example: values/A1:C1:append?valueInputOption=RAW Figure out the request body. For example: {values: [["foo", "bar", "baz"]]}
clayway avatar
callGoogleSheetsAPI
@clayway
Script
Forked from mattx/gsheet_call
gwelinder avatar
gsheet_call
@gwelinder
Script
Forked from hiteshjoshi/gsheet_call
hiteshjoshi avatar
gsheet_call
@hiteshjoshi
Script
Forked from mattx/gsheet_call
mmrech avatar
gsheet_call
@mmrech
Script
Forked from mattx/gsheet_call
apois avatar
gsheet_call
@apois
Script
Forked from hiteshjoshi/gsheet_call
stevekrouse avatar
pipedream
@stevekrouse
Script
Pipedream helpers Pipedream offers an Accounts API to handle OAuth for you, automatically, and for free. How to do it is covered in this guide . The helper functions below can make it easier to work with various Google API. For example, I used them like so to get all my free/busy times for this week from all my google calendars: import { pipeDreamGoogle } from "https://esm.town/v/stevekrouse/pipedream"; const accountId = "REPLACE_WITH_YOUR_GCAL_ACCOUNT_ID_FROM_PIPEDREAM"; const calendar = await pipeDreamGoogle("calendar", accountId); // Function to get free/busy information async function getFreeBusyTimes(calendarId: string) { const now = new Date(); const startOfWeek = new Date(now); startOfWeek.setDate(now.getDate() - now.getDay()); const endOfWeek = new Date(startOfWeek); endOfWeek.setDate(startOfWeek.getDate() + 6); const requestBody = { timeMin: startOfWeek.toISOString(), timeMax: endOfWeek.toISOString(), items: [{ id: calendarId }], }; const freeBusyResponse = await calendar.freebusy.query({ requestBody, }); return freeBusyResponse.data.calendars[calendarId].busy; } const calendars = (await calendar.calendarList.list()).data.items; const freeBusy = await Promise.all(calendars.map(calendar => getFreeBusyTimes(calendar.id))); console.log(freeBusy); In order for this to work you need to follow the instructions in this guide to save your pipedream API key into your Val Town Environment Variables under pipedream , then connect the google account you care about to Pipedream, and copy it's Pipedream "account id" into your val code. Let me know if you need any help by commenting on this val!