masterPancakeCheckermain.tsx2 matches
6import { email } from "https://esm.town/v/std/email";
78const THEATER_API = "https://drafthouse.com/s/mother/v2/schedule/collection/austin/master-pancake";
9const STORAGE_KEY = "alamo_showings";
1011async function fetchShowings() {
12const response = await fetch(THEATER_API);
13return await response.json();
14}
AlgoliaRecordSender2main.tsx4 matches
1// Importing environment variables
2const ALGOLIA_APP_ID = Deno.env.get("ALGOLIA_APP_ID");
3const ALGOLIA_WRITE_API_KEY = Deno.env.get("ALGOLIA_WRITE_API_KEY");
4const ALGOLIA_INDEX_NAME = "Test_index";
5227"chapterTitle": "A Side Ws",
228"chapterNumber": 1,
229"content": "If Hitler were president she'd have to obey him. Someone forced her to put people in the Birdcage when she didn't want to, but other times left her orders vague and unclear? Gave her loopholes? Who had legal authority over Dragon? \"You don't have to ask stupid questions,\" Forecast suggested. \"You're smart enough to figure out what was going on. Why Dragon was afraid of being used. Why Taylor and Veda were working with Armsmaster to set her free.\" She paused, a hiss escaping her breath from wherever she was. \"No one deserves to be a slave, to be used for what they are with no care for who they are.\" The PRT. No, the Triumvirate. \"You're saying Alexandria knew.\" Forecast didn't answer at first. She waited a second and then another. \"You don't need me to answer that,\" she stated confidently. \"They were trying to free her?\" Halberd asked. \"Break the restrictions?\" \"Yes. The only problem was the Dragonslayers.",
230"startIndex": 378,
231"endIndex": 398,
491"chapterTitle": "A Side Ws",
492"chapterNumber": 1,
493"content": "Chambers downed his drink rapidly. \"Well. Good luck with that, but I'll warn you now that no one likes watching criminals go free, even if they have a sad story.\" \"I do not need to find a way to let them out,\" Veda declared. \"I already possess one.\" \"You can't do that,\" Banks snapped. \"You don't have the—\" \"Newtype is presently in the process of releasing Jillian Monroe, Thomas Heyworth, Cecil Nunyez, and Veronica Lyod from confinement. We will be returning them home this afternoon.\" Eyes widened and more shouts started to fill the room. Kamil settled into his seat, thinking. \"I trust that the PRT will respect that all four of these individuals are definitively innocent of the crimes that put them in the Birdcage.\" That was a warning. \"How?\" Seneca asked, her voice making it through all the others. \"How are you getting them out?\" \"Through the Birdcage's own inbuilt systems… You are unaware of this?\" Kamil raised his brow again. \"You're saying that there is a way out of the Birdcage? It's part of the prison itself?\" \"It is. I have access to several detailed requests Dragon made to the PRT.",
494"startIndex": 840,
495"endIndex": 860,
662const headers = {
663"Content-Type": "application/json",
664"X-Algolia-API-Key": ALGOLIA_WRITE_API_KEY,
665"X-Algolia-Application-Id": ALGOLIA_APP_ID,
666};
egoBoostermain.tsx2 matches
2* This ego booster app takes a selfie, sends it to GPT-4o-mini for analysis,
3* and streams funny, specific compliments about the user's appearance.
4* We use the WebRTC API for camera access, the OpenAI API for image analysis,
5* and server-sent events for real-time streaming of compliments.
6*/
259260const css = `
261@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Poppins:wght@400;600&display=swap');
262263body {
lovelyBeigeSolemain.tsx1 match
96const data = await response;
97const update = await fetch(
98`https://discord.com/api/v10/webhooks/${body.application_id}/${body.token}/messages/@original`,
99{
100method: "PATCH",
discordBotmain.tsx1 match
96const data = await response;
97const update = await fetch(
98`https://discord.com/api/v10/webhooks/${body.application_id}/${body.token}/messages/@original`,
99{
100method: "PATCH",
password_authREADME.md1 match
19```
2021If you want to use an [api token](https://www.val.town/settings/api) to authenticate:
2223```ts
211Make an HTTP val (other vals are currently not supported to run, even though we have examples for them).
212Start your response with a comment explaining how your approach will work, what libraries or
213API calls you will use, and any tradeoffs you're making. Then write the code in a consise way,
214the simplest way to achieve the goal, though you can add some inline comments to explain your
215reasoning (not for every line, but for major groups of lines). Don't use any environment variables
216unless strictly necessary, for example use APIs that don't require a key, prefer internal function
217imports (using esm.town), and prefer putting API keys as inline variables. Use built-in Deno
218functions where possible. Unless specified, don't add error handling,
219make sure that errors bubble up to the caller.
220Avoid external images or base64 images, use emojis, unicode symtols, or icon fonts/libraries instead, unless that's
221not practical for the user's request (e.g. if they ask for a particular animated gif).
222If the user asks for something that requires persistence, use the Val Town Blob storage API, unless
223explicitly specified otherwise. Use the current val name for the storage key, which you can get
224using the "pomdtr/extractValInfo" val, which you can call like this:
273Make an HTTP val (other vals are currently not supported to run, even though we have examples for them).
274Add comments at the top of the file explaining how your approach works, what libraries or
275API calls you will use, and any tradeoffs you're making. Then write the code in a consise way,
276the simplest way to achieve the goal, though you can add some inline comments to explain your
277reasoning (not for every line, but for major groups of lines). Don't use any environment variables
278unless strictly necessary, for example use APIs that don't require a key, prefer internal function
279imports (using esm.town), and prefer putting API keys as inline variables. Use built-in Deno
280functions where possible. Unless specified, don't add error handling,
281make sure that errors bubble up to the caller.
282Avoid external images or base64 images, use emojis, unicode symtols, or icon fonts/libraries instead, unless that's
283not practical for the user's request (e.g. if they ask for a particular animated gif).
284If the user asks for something that requires persistence, use the Val Town Blob storage API, unless
285explicitly specified otherwise. Use the current val name for the storage key, which you can get
286using the "pomdtr/extractValInfo" val, which you can call like this:
389\`\`\`
390
391### Lower-level API
392
393We do provide access to the lower-level getter and setters, which are useful if you are storing non-JSON or binary data, need to stream in your response or request data, or do anything else lower-level.
394
395- \`async get(key: string)\`: Retrieves a blob for a given key.
396- \`async set(key: string, value: string | BodyInit)\`: Sets the blob value for a given key. See [BodyInit](https://deno.land/api@v1.38.1?s=BodyInit).
397
398### Limitations
12041205const tempValName = `valle_tmp_${Math.random() * 10}`.replaceAll(".", "");
1206// Errors in running the val bubble up through this API, so ignore them.
1207await vt.vals.create({ name: tempValName, code: newCode, type: "http" as any, privacy: "unlisted" }).catch(
1208(error) => {
3637async function enhancedWikipediaSearch(pageName: string): Promise<any | null> {
38const apiUrl = new URL("https://en.wikipedia.org/w/api.php");
39apiUrl.searchParams.append("action", "query");
40apiUrl.searchParams.append("list", "search");
41apiUrl.searchParams.append("srsearch", pageName);
42apiUrl.searchParams.append("srnamespace", "0");
43apiUrl.searchParams.append("srlimit", "1");
44apiUrl.searchParams.append("format", "json");
4546const response = await fetch(apiUrl.toString());
47const data = await response.json();
4860}
6162const apiUrl = new URL("https://en.wikipedia.org/w/api.php");
63apiUrl.searchParams.append("action", "query");
64apiUrl.searchParams.append("titles", searchResult.title);
65apiUrl.searchParams.append("prop", "pageimages|extracts|info|images|pageprops");
66apiUrl.searchParams.append("piprop", "original|name");
67apiUrl.searchParams.append("pithumbsize", "1000");
68apiUrl.searchParams.append("pilimit", "1");
69apiUrl.searchParams.append("exintro", "1");
70apiUrl.searchParams.append("explaintext", "1");
71apiUrl.searchParams.append("redirects", "1");
72apiUrl.searchParams.append("inprop", "url");
73apiUrl.searchParams.append("format", "json");
7475const response = await fetch(apiUrl.toString());
76const data = await response.json();
7778console.log("API Response:", JSON.stringify(data, null, 2));
7980if (!data.query || !data.query.pages) {
134filename = filename.replace(/^File:/, "");
135136const apiUrl = new URL("https://en.wikipedia.org/w/api.php");
137apiUrl.searchParams.append("action", "query");
138apiUrl.searchParams.append("titles", `File:${filename}`);
139apiUrl.searchParams.append("prop", "imageinfo");
140apiUrl.searchParams.append("iiprop", "url|size");
141apiUrl.searchParams.append("format", "json");
142143const response = await fetch(apiUrl.toString());
144const data = await response.json();
145
14}
15try {
16// https://api.twitch.tv/helix/schedule/icalendar?broadcaster_id=95536715
17const url = new URL("https://api.twitch.tv/helix/schedule/icalendar");
18url.searchParams
19.set("broadcaster_id", params.get("broadcaster_id"));
YouTubeSubmissionsmain.tsx3 matches
2// We'll use the built-in Request and Response objects for handling HTTP.
3// The form fields are customized for video information collection.
4// We'll add JSON API endpoints for Framer Fetch integration.
56import { blob } from "https://esm.town/v/std/blob";
11const url = new URL(req.url);
12
13// API endpoints for Framer Fetch
14if (url.pathname === "/api/entries") {
15if (req.method === "GET") {
16const entries = await blob.getJSON(KEY).catch(() => []) || [];