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/?q=fetch&page=249&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 11150 results for "fetch"(1661ms)

lyristmain.ts12 matches

@g•Updated 2 weeks ago
32
33 try {
34 // 1. Fetch suggestions
35 const suggestUrl = `https://api.lyrics.ovh/suggest/${encodeURIComponent(query)}`;
36 console.log(`Fetching suggestions from: ${suggestUrl}`);
37 const suggestResponse = await fetch(suggestUrl);
38
39 if (!suggestResponse.ok) {
40 console.error(`Error fetching suggestions: ${suggestResponse.status} ${suggestResponse.statusText}`);
41 const errorBody = await suggestResponse.text();
42 console.error(`Error body: ${errorBody}`);
43 return c.json({ error: 'Failed to fetch song suggestions', details: errorBody }, suggestResponse.status);
44 }
45
58 console.log(`Found song: Title - ${actualTitle}, Artist - ${actualArtist}`);
59
60 // 3. Fetch lyrics
61 const lyricsUrl = `https://api.lyrics.ovh/v1/${encodeURIComponent(actualArtist)}/${encodeURIComponent(actualTitle)}`;
62 console.log(`Fetching lyrics from: ${lyricsUrl}`);
63 const lyricsResponse = await fetch(lyricsUrl);
64
65 if (!lyricsResponse.ok) {
66 console.error(`Error fetching lyrics: ${lyricsResponse.status} ${lyricsResponse.statusText}`);
67 const errorBody = await lyricsResponse.text();
68 console.error(`Error body: ${errorBody}`);
72 return c.json({ error: errorJson.error || 'Lyrics not found for this song' }, 404);
73 }
74 return c.json({ error: 'Failed to fetch lyrics', details: errorBody }, lyricsResponse.status);
75 }
76
125});
126
127// Export the fetch handler for the worker
128export default app.fetch;

JobPlatformindex.ts1 match

@MiracleSanctuary•Updated 2 weeks ago
41
42// This is the entry point for HTTP vals
43export default app.fetch;

JobPlatformapp.js8 matches

@MiracleSanctuary•Updated 2 weeks ago
85async function loadJobs() {
86 try {
87 const response = await fetch('/api/jobs');
88 if (!response.ok) throw new Error('Failed to fetch jobs');
89
90 const jobs = await response.json();
120 };
121
122 const response = await fetch('/api/jobs', {
123 method: 'POST',
124 headers: {
187async function loadChatMessages() {
188 try {
189 const response = await fetch('/api/chat');
190 if (!response.ok) throw new Error('Failed to fetch chat messages');
191
192 const messages = await response.json();
235 if (lastChatTimestamp) {
236 try {
237 const response = await fetch(`/api/chat/recent?since=${lastChatTimestamp}`);
238 if (!response.ok) throw new Error('Failed to fetch recent messages');
239
240 const newMessages = await response.json();
278
279 try {
280 const response = await fetch('/api/chat', {
281 method: 'POST',
282 headers: {

JobPlatformchat.ts4 matches

@MiracleSanctuary•Updated 2 weeks ago
12 return c.json(messages);
13 } catch (error) {
14 console.error("Error fetching chat messages:", error);
15 return c.json({ error: "Failed to fetch chat messages" }, 500);
16 }
17});
28 return c.json(messages);
29 } catch (error) {
30 console.error("Error fetching recent chat messages:", error);
31 return c.json({ error: "Failed to fetch recent chat messages" }, 500);
32 }
33});

JobPlatformjobs.ts4 matches

@MiracleSanctuary•Updated 2 weeks ago
11 return c.json(jobsList);
12 } catch (error) {
13 console.error("Error fetching jobs:", error);
14 return c.json({ error: "Failed to fetch jobs" }, 500);
15 }
16});
31 return c.json(job);
32 } catch (error) {
33 console.error("Error fetching job:", error);
34 return c.json({ error: "Failed to fetch job" }, 500);
35 }
36});

lyristlyricsProcessor.ts8 matches

@g•Updated 2 weeks ago
23*/
24
25import { fetch as proxiedFetch } from "https://esm.town/v/std/fetch";
26import * as cheerio from "npm:cheerio";
27import { fetchLyricsMetadata } from "./lyrics";
28
29/**
55 }
56
57 const res = await fetchLyricsMetadata(query);
58
59 if (res.status === 200 && res.url !== "Not found") {
63 "Accept-Language": "en-US,en;q=0.9",
64 "Cache-Control": "max-age=0",
65 "Sec-Fetch-Dest": "document",
66 "Sec-Fetch-Mode": "navigate",
67 "Sec-Fetch-Site": "none",
68 "Sec-Fetch-User": "?1",
69 "Sec-Gpc": "1",
70 "Upgrade-Insecure-Requests": "1",
80 }
81
82 const response = await fetch(res.url, { headers: headers });
83 const targetHtml = await response.text();
84 let $ = cheerio.load(targetHtml);

lyristlyrics.ts3 matches

@g•Updated 2 weeks ago
23*/
24
25import { fetch as proxiedFetch } from "https://esm.town/v/std/fetch";
26
27interface LyricsResponse {
53}
54
55export const fetchLyricsMetadata = async (
56 searchTerm: string,
57): Promise<LyricsResponse> => {
73
74 // Make the API request
75 const response = await proxiedFetch(target, { headers });
76 const data = await response.json();
77

Akashindex.ts9 matches

@Akashashn•Updated 2 weeks ago
106 return c.json({ success: true, data: resumes });
107 } catch (error) {
108 console.error("Error fetching resumes:", error);
109 return c.json({ success: false, error: "Failed to fetch resumes" }, 500);
110 }
111});
125 return c.json({ success: true, data: resume });
126 } catch (error) {
127 console.error("Error fetching resume:", error);
128 return c.json({ success: false, error: "Failed to fetch resume" }, 500);
129 }
130});
169 return c.json({ success: true, data: jobs });
170 } catch (error) {
171 console.error("Error fetching job requirements:", error);
172 return c.json({ success: false, error: "Failed to fetch job requirements" }, 500);
173 }
174});
188 return c.json({ success: true, data: job });
189 } catch (error) {
190 console.error("Error fetching job requirement:", error);
191 return c.json({ success: false, error: "Failed to fetch job requirement" }, 500);
192 }
193});
298
299// Export the Hono app
300export default app.fetch;

AkashApp.tsx21 matches

@Akashashn•Updated 2 weeks ago
26 const [error, setError] = useState<string | null>(null);
27
28 // Fetch resumes and jobs on initial load
29 React.useEffect(() => {
30 fetchResumes();
31 fetchJobs();
32 }, []);
33
34 // Fetch all resumes
35 const fetchResumes = async () => {
36 try {
37 const response = await fetch("/api/resumes");
38 const data = await response.json();
39
41 setResumes(data.data);
42 } else {
43 setError(data.error || "Failed to fetch resumes");
44 }
45 } catch (error) {
46 console.error("Error fetching resumes:", error);
47 setError("Failed to fetch resumes");
48 }
49 };
50
51 // Fetch all jobs
52 const fetchJobs = async () => {
53 try {
54 const response = await fetch("/api/jobs");
55 const data = await response.json();
56
58 setJobs(data.data);
59 } else {
60 setError(data.error || "Failed to fetch jobs");
61 }
62 } catch (error) {
63 console.error("Error fetching jobs:", error);
64 setError("Failed to fetch jobs");
65 }
66 };
72
73 try {
74 const response = await fetch("/api/resumes", {
75 method: "POST",
76 headers: {
84 if (data.success) {
85 // Refresh resumes list
86 await fetchResumes();
87 setActiveTab("results");
88 } else {
103
104 try {
105 const response = await fetch("/api/jobs", {
106 method: "POST",
107 headers: {
115 if (data.success) {
116 // Refresh jobs list
117 await fetchJobs();
118 setSelectedJob(data.data);
119 setActiveTab("results");
154
155 // Score resumes
156 const response = await fetch("/api/score/batch", {
157 method: "POST",
158 headers: {
184
185 try {
186 const response = await fetch("/api/score", {
187 method: "POST",
188 headers: {

Testindex.ts1 match

@Anie_keme•Updated 2 weeks ago
20
21 // Read the HTML file content
22 const response = await fetch(new URL(htmlFile, import.meta.url));
23 const html = await response.text();
24

fetch-socials

@welson•Updated 57 mins ago
fetch and archive my social posts

fetchRssForSubcurrent2 file matches

@ashryanio•Updated 3 hours ago