Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$2?q=fetch&page=1038&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 12867 results for "fetch"(7673ms)

lovelyBeigeSolemain.tsx2 matches

@meglado•Updated 9 months ago
1import { verify_discord_signature } from "https://esm.town/v/mattx/verify_discord_signature?v=8";
2import { fetch } from "https://esm.town/v/std/fetch";
3
4export type Snowflake = string;
95 (async () => {
96 const data = await response;
97 const update = await fetch(
98 `https://discord.com/api/v10/webhooks/${body.application_id}/${body.token}/messages/@original`,
99 {

discordBotmain.tsx2 matches

@meglado•Updated 9 months ago
1import { verify_discord_signature } from "https://esm.town/v/mattx/verify_discord_signature?v=8";
2import { fetch } from "https://esm.town/v/std/fetch";
3
4export type Snowflake = string;
95 (async () => {
96 const data = await response;
97 const update = await fetch(
98 `https://discord.com/api/v10/webhooks/${body.application_id}/${body.token}/messages/@original`,
99 {

VALLErunmain.tsx2 matches

@cofsana•Updated 9 months ago
918 code: newCode,
919 });
920 fetch('/save', { method: "POST", body }).then(() => {
921 document.getElementById('code-input-hidden').value = newCode;
922 document.getElementById('preview-iframe').src += '';
1284 app.post("/", mainHandler);
1285
1286 return passwordAuth(app.fetch, { verifyPassword: verifyToken });
1287}

DailyDaughterNotesmain.tsx5 matches

@heathergliffin•Updated 9 months ago
14
15 useEffect(() => {
16 fetchTodayNote();
17 }, []);
18
19 const fetchTodayNote = async () => {
20 setLoading(true);
21 const response = await fetch("/get-note");
22 const data = await response.json();
23 setNote(data.note);
27 const generateNewNote = async () => {
28 setLoading(true);
29 await fetch("/generate-note", { method: "POST" });
30 await fetchTodayNote();
31 };
32

eldestBronzePtarmiganmain.tsx7 matches

@ejfox•Updated 9 months ago
16
17 useEffect(() => {
18 fetchUser();
19 fetchMatches();
20 }, []);
21
22 const fetchUser = async () => {
23 const response = await fetch('/user');
24 if (response.ok) {
25 const userData = await response.json();
30 };
31
32 const fetchMatches = async () => {
33 const response = await fetch('/matches');
34 if (response.ok) {
35 const matchesData = await response.json();
44 formData.append('type', type);
45
46 const response = await fetch('/upload', {
47 method: 'POST',
48 body: formData,

WikiImagemain.tsx6 matches

@ampp•Updated 9 months ago
13}
14
15export const fetchWikipediaImage = async (request: Request): Promise<Response> => {
16 const url = new URL(request.url);
17 const pageName = url.searchParams.get("title");
30 return formatResponse(pageData, format);
31 } catch (error) {
32 console.error("Error fetching Wikipedia image:", error);
33 return new Response("An error occurred while fetching the image", { status: 500 });
34 }
35};
44 apiUrl.searchParams.append("format", "json");
45
46 const response = await fetch(apiUrl.toString());
47 const data = await response.json();
48
73 apiUrl.searchParams.append("format", "json");
74
75 const response = await fetch(apiUrl.toString());
76 const data = await response.json();
77
141 apiUrl.searchParams.append("format", "json");
142
143 const response = await fetch(apiUrl.toString());
144 const data = await response.json();
145

lucia_middlewaremain.tsx1 match

@stevekrouse•Updated 9 months ago
212 return response;
213 });
214 return app.fetch;
215};

twitchmain.tsx1 match

@pinjasaur•Updated 9 months ago
1const getText = async url => (await fetch(url)).text();
2
3export default async function(req: Request): Promise<Response> {

YouTubeSubmissionsmain.tsx2 matches

@mvmattgray•Updated 9 months ago
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.
5
6import { blob } from "https://esm.town/v/std/blob";
11 const url = new URL(req.url);
12
13 // API endpoints for Framer Fetch
14 if (url.pathname === "/api/entries") {
15 if (req.method === "GET") {

getWeatherForecastmain.tsx2 matches

@cjpais•Updated 9 months ago
13
14 try {
15 const weatherResponse = await fetch(weatherApiUrl);
16 if (!weatherResponse.ok) {
17 throw new Error(`Weather API request failed with status: ${weatherResponse.status}`);
33 });
34 } catch (err) {
35 return new Response("Error fetching weather data: " + err.message, {
36 status: 500, // Internal Server Error
37 headers: { "Content-Type": "text/plain" },

fetch-socials4 file matches

@welson•Updated 2 days ago
fetch and archive my social posts

fetchRssForSubcurrent2 file matches

@ashryanio•Updated 2 days ago