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?q=fetch&page=185&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 10803 results for "fetch"(825ms)

aaindex.html1 match

@msd•Updated 1 week ago
116 try {
117 // Replace with your actual Val Town endpoint URL
118 const response = await fetch(window.location.href, {
119 method: 'POST',
120 headers: {

satori-syntax-highlighterindex.tsx2 matches

@stevekrouse•Updated 1 week ago
25});
26
27// Export the fetch handler for Val Town
28export default app.fetch;

linesmain.tsx3 matches

@stevekrouse•Updated 1 week ago
34 const lineEnd = lineMatch[2] ? parseInt(lineMatch[2], 10) : lineStart;
35
36 // Fetch the code
37 const valTownUrl = `https://esm.town/v/${username}/${project}/${filepath}`;
38 const codeResponse = await fetch(valTownUrl);
39
40 if (!codeResponse.ok) {
41 return new Response(`Failed to fetch code: ${codeResponse.statusText}`, { status: 500 });
42 }
43
89 const fontUrl =
90 "https://cdn.jsdelivr.net/npm/@fontsource/ibm-plex-mono@5.0.8/files/ibm-plex-mono-latin-700-normal.woff";
91 const fontResponse = await fetch(fontUrl);
92 return await fontResponse.arrayBuffer();
93}

hn-fetchindex.tsx4 matches

@matija•Updated 1 week ago
1async function fetchHackerNews() {
2 try {
3 const response = await fetch("https://news.ycombinator.com/");
4
5 if (!response.ok) {
10 console.log(html);
11 } catch (error) {
12 console.error("Failed to fetch Hacker News:", error);
13 }
14}
15
16export default async function(req: Request): Promise<Response> {
17 const hackerNews = await fetchHackerNews();
18 // return Response.json({ ok: true })
19 return Response.json({ ok: true, hackerNews });

untitled-860checkCert.tsx3 matches

@jclack2•Updated 1 week ago
7
8 try {
9 // Using node-fetch to make a request to the domain
10 // This is a simple way to access the certificate info
11 const controller = new AbortController();
12 const timeoutId = setTimeout(() => controller.abort(), 10000); // 10 second timeout
13
14 const response = await fetch(`https://${domain}`, {
15 method: "HEAD", // We only need the headers
16 signal: controller.signal,
19 clearTimeout(timeoutId);
20
21 // Unfortunately, the fetch API doesn't give us direct access to the certificate
22 // So we need to use the tls module in Node.js or Deno's TLS APIs
23

govaltownmain.tsx1 match

@bradnoble•Updated 1 week ago
44});
45
46export default app.fetch;
5 const host = "www.cdatacloud.net";
6
7 const analyzeRes = await fetch(`https://api.ssllabs.com/api/v3/analyze?host=${host}`);
8 const analyzeJson = await analyzeRes.json();
9
17 }
18
19 const endpointRes = await fetch(
20 `https://api.ssllabs.com/api/v3/getEndpointData?host=${host}&ip=${endpoint.ipAddress}`,
21 );

sa_pro1prompt-expander.ts1 match

@pro3•Updated 1 week ago
109
110 try {
111 const response = await fetch('/expand', {
112 method: 'POST',
113 headers: {

sa_proprompt-expander.ts1 match

@pro3•Updated 1 week ago
199
200 try {
201 const response = await fetch('/api/expand', {
202 method: 'POST',
203 headers: {

HN-fetch-call2 file matches

@ImGqb•Updated 8 hours ago
fetch HackerNews by API

FRAMERFetchBasic1 file match

@bresnik•Updated 1 day ago