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/image-url.jpg%20%22Optional%20title%22?q=fetch&page=1102&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 16246 results for "fetch"(3942ms)

emojiExplodermain.tsx1 match

@stevekrouse•Updated 4 months ago
108// });
109
110// export default app.fetch;
111export default () => Response.json("Broken import, sad");

instagramScrapingutils.ts6 matches

@wolf•Updated 4 months ago
44 }
45
46 const postHtml = await fetch(`https://www.instagram.com/p/${id}/`).then((
47 response,
48 ) => response.text());
55
56 return {
57 imageUrl: await fetch(`https://www.instagram.com/p/${id}/media/?size=l`, {
58 headers: {
59 "Accept":
66 "Host": "www.instagram.com",
67 "Priority": "u=0, i",
68 "Sec-Fetch-Dest": "document",
69 "Sec-Fetch-Mode": "navigate",
70 "Sec-Fetch-Site": "none",
71 "Sec-Fetch-User": "?1",
72 "TE": "trailers",
73 "Upgrade-Insecure-Requests": "1",

instagramScrapingindex.tsx11 matches

@wolf•Updated 4 months ago
39 if (c.req.query("proxyImage") === "true") {
40 try {
41 const imageResponse = await fetch(imageUrl);
42 if (!imageResponse.ok) {
43 throw new Error(`Failed to fetch image: ${imageResponse.status}`);
44 }
45
50 headers: { "Content-Type": contentType },
51 });
52 } catch (fetchError) {
53 if (fetchError instanceof Error) {
54 return c.json({
55 error: "Failed to proxy image: " + fetchError.message,
56 }, 502);
57 }
106 if (c.req.query("proxyImage") === "true") {
107 try {
108 const imageResponse = await fetch(imageUrl);
109 if (!imageResponse.ok) {
110 throw new Error(`Failed to fetch image: ${imageResponse.status}`);
111 }
112
117 headers: { "Content-Type": contentType },
118 });
119 } catch (fetchError) {
120 if (fetchError instanceof Error) {
121 return c.json({
122 error: "Failed to proxy image: " + fetchError.message,
123 }, 502);
124 }
151});
152
153export default app.fetch;
154

instagramScrapingREADME.md1 match

@wolf•Updated 4 months ago
12
131. Enter an Instagram post URL in the input field
142. The application will fetch the image and caption
153. Copy the text with attribution using the "Copy Text" button
164. Save the image (on mobile tap and hold)

instagramScrapingApp.tsx3 matches

@wolf•Updated 4 months ago
12 useEffect(() => {
13 if (url) {
14 fetch(`/extract?url=${encodeURIComponent(url)}`)
15 .then((response) => response.json())
16 .then((data) => {
20 })
21 .catch((error) => {
22 console.error("Error fetching data:", error);
23 setResultText("Error fetching data");
24 setResultImage("");
25 });

BingImageOfDayREADME.md2 matches

@wolf•Updated 4 months ago
1# Bing Image of the Day Archive
2
3This Val Town project fetches, displays, and archives the Bing Image of the Day, providing an API to access both current and historical images.
4
5## Overview
6
7- Fetch the current Bing Image of the Day
8- Archive images to Val Town blob storage with date-based naming
9- List all archived images with their dates

BingImageOfDayfetchBingImage.tsx8 matches

@wolf•Updated 4 months ago
1/**
2 * Helper function to fetch the Bing Image of the Day
3
4 * @returns Promise containing the image response
5 */
6export async function fetchBingImage(): Promise<Response> {
7 try {
8 // Fetch the HTML page
9 const pageResponse = await fetch("https://bing.gifposter.com");
10 const html = await pageResponse.text();
11
17 const imageUrl = match[1].replace("_mb", "");
18
19 // Fetch the actual image
20 const imageResponse = await fetch(imageUrl);
21
22 if (!imageResponse.ok) {
23 throw new Error(`Failed to fetch image: ${imageResponse.status}`);
24 }
25
35 } catch (error) {
36 console.error("Error:", error);
37 return new Response(`Error fetching image: ${error.message}`, {
38 status: 500,
39 headers: { "Content-Type": "text/plain" },

BingImageOfDaybackupImage.tsx4 matches

@wolf•Updated 4 months ago
1import { blob } from "https://esm.town/v/std/blob";
2import { fetchBingImage } from "./fetchBingImage.tsx";
3
4/**
7export async function backupBingImage(): Promise<void> {
8 try {
9 // Fetch the Bing image of the day using our helper
10 const response = await fetchBingImage();
11
12 if (!response.ok) {
26 console.log(`Bing image of the day saved: ${filename}`);
27 } catch (error) {
28 console.error("Failed to fetch or save Bing image:", error);
29 }
30}

reactHonoExamplegoogleOAuth.ts3 matches

@varun1352•Updated 4 months ago
15
16 // Exchange code for tokens
17 const tokenResponse = await fetch("https://oauth2.googleapis.com/token", {
18 method: "POST",
19 headers: { "Content-Type": "application/x-www-form-urlencoded" },
29 const { access_token, id_token } = await tokenResponse.json();
30
31 // Fetch user info
32 const userInfoResponse = await fetch("https://www.googleapis.com/oauth2/v3/userinfo", {
33 headers: { Authorization: `Bearer ${access_token}` },
34 });

reactHonoExampleindex.ts1 match

@varun1352•Updated 4 months ago
41});
42
43export default app.fetch;

readwise-instapaper1 file match

@welson•Updated 2 days ago
Fetches my articles from Readwise. Syncs with/ Neon + Instapaper

manual-fetcher

@miz•Updated 2 weeks ago