3export const loaderSampleAudio = (async () => {
4 const builder = await getWebLoaderBuilder(
5 "https://storage.googleapis.com/aai-docs-samples/sports_injuries.mp3",
6 "audio",
7 { language_code: "en_us" },
16 const browser = await puppeteer.connect({
17 browserWSEndpoint:
18 `wss://chrome.browserless.io?token=${process.env.BROWSERLESS_API_KEY}`,
19 });
20 const page = await browser.newPage();
3// Github following
4export let githubFollowing = fetchJSON(
5 "https://api.github.com/users/stevekrouse/following"
6);
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function postHogAPICapture({ key, event, properties, distinct_id }: {
4 key: string;
5 event: string;
8}) {
9 const body = {
10 "api_key": key,
11 "event": event,
12 "properties": properties,
2
3export let authTwitter = authTwitter2(
4 "https://api.twitter.com/1.1/search/tweets.json?q=nasa&result_type=popular&count=10"
5);
1export function myApi(name) {
2 return "hi " + name;
3}
3export const fetchBcycleCounts = (async () => {
4 const tokenResponse = await fetch(
5 "https://boulder.bcycle.com/api/bearertoken/getclient?_=1673303289964",
6 {
7 headers: {
24 const tokenData = await tokenResponse.json();
25 const dataResponse = await fetch(
26 "https://portal-den.bcycle.com/1/publicApi/kiosks?programId=54&refresh=true&_=1673303289965",
27 {
28 headers: {
3// GitHub gists
4export let githubGists = fetchJSON(
5 "https://api.github.com/users/stevekrouse/gists"
6);
1## Get All Videos in a Youtube Playlist using the Youtube Data API v3
2
3Reference: https://developers.google.com/youtube/v3/docs/playlistItems/list
30```
31
32Finally, you may be wondering why I queue up feedback in `@stevekrouse.docsFeedback`, a private JSON val, and then process it via [`@stevekrouse.formFeedbackAlert`](https://www.val.town/v/stevekrouse.formFeedbackAlert) instead of sending it along to Discord directly in this val. I [tried that originally](https://www.val.town/v/stevekrouse.docFeedbackForm?v=61) but it felt too slow to wait for the API call to Discord before returning the "Thanks for your feedback" message. This is where the `context.waitUntil` method (that Cloudflare workers and Vercel Edge Functions support) would really come in handy – those allow you to return a Response, and then continue to compute. Currently Val Town requires you to stop all compute with the returning of your Response, so the only way to compute afterwards is to queue it up for another val to take over, and that's what I'm doing here.
33
34