laionazeredo avatar
laionazeredo
nasaAPOD
Script
Forked from iBrokeit/nasaAPOD
0
stevekrouse avatar
stevekrouse
pipedream
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!
0
hootz avatar
hootz
textToImageDalle
Script
A wrapper for OpenAI's DALLE API. See the API reference here: https://platform.openai.com/docs/api-reference/images/create?lang=curl
0
mdgrech avatar
mdgrech
umbrellaReminder
Cron
Forked from stevekrouse/umbrellaReminder
0
stevekrouse avatar
stevekrouse
runGET
Script
An interactive, runnable TypeScript val by stevekrouse
0
stevekrouse avatar
stevekrouse
effortlessCrimsonDolphin
Script
Forked from stevekrouse/twitterAlert
0
benlenarts avatar
benlenarts
SongTagger
HTTP
Forked from hunty/spotify
0
valstu avatar
valstu
nasaAPOD
Script
// Returns NASA's Astronomy Picture of the Day (APOD)
0
stevekrouse avatar
stevekrouse
getMe
Script
An interactive, runnable TypeScript val by stevekrouse
0
sieteunoseis avatar
sieteunoseis
dailyDadJoke
HTTP
Forked from stevekrouse/dailyDadJoke
0
cpgo avatar
cpgo
githubUser
Script
An interactive, runnable TypeScript val by cpgo
0
pomcute avatar
pomcute
arenaChannelContents
Script
Get all content ("blocks") from an Are.na channel https://dev.are.na/documentation/channels
0
jamesw avatar
jamesw
trendingrepos
Script
// Helper function to format the date for GitHub API query
0
stevekrouse avatar
stevekrouse
discordMessages
Script
An interactive, runnable TypeScript val by stevekrouse
0
kognise avatar
kognise
stopDepartures
Script
An interactive, runnable TypeScript val by kognise
0
hkg avatar
hkg
githubUser
Script
An interactive, runnable TypeScript val by hkg
0
Updated: July 2, 2024