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=190&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 11122 results for "fetch"(2795ms)

NPLLMPackageDetailPage.tsx4 matches

@wolf•Updated 1 week ago
28
29 useEffect(() => {
30 const fetchPackageDetails = async () => {
31 try {
32 // Fetch package details
33 const response = await client.package
34 .$get({ query: { name: packageName } });
37 setReadme(marked(data.readme || ""));
38 } catch (error) {
39 console.error("Error fetching package details:", error);
40 } finally {
41 setLoading(false);
43 };
44
45 fetchPackageDetails();
46 }, [packageName]);
47

NPLLMindex.ts1 match

@wolf•Updated 1 week ago
33 });
34
35export default app.fetch;
36

NPLLMSearchPage.tsx5 matches

@wolf•Updated 1 week ago
24 );
25
26 const fetchPackages = async (
27 searchQuery: string,
28 pageNum: number,
73 setLoading(false);
74 } catch (error) {
75 console.error("Error fetching packages:", error);
76 setLoading(false);
77 }
82 setItems([]);
83 setQuery(searchQuery);
84 fetchPackages(searchQuery, 1);
85 };
86
89 const nextPage = page + 1;
90 setPage(nextPage);
91 fetchPackages(query, nextPage, true);
92 };
93
94 useEffect(() => {
95 fetchPackages(query, 1);
96 }, []);
97

NPLLMProfilePicture.tsx5 matches

@wolf•Updated 1 week ago
14): Promise<string> => {
15 try {
16 const response = await fetch(
17 "https://stevekrouse--411c225025f011f0ad23569c3dd06744.web.val.run/api/fal/proxy",
18 {
56
57 useEffect(() => {
58 // If we already have an image URL, don't fetch a new one
59 if (imageUrl) {
60 setProfileImage(imageUrl);
63 }
64
65 // If we're already loading or have an image, don't fetch again
66 if (!isLoading || profileImage) return;
67
68 // Generate a profile picture if we don't have one
69 const fetchProfilePicture = async () => {
70 const prompt = `${packageId} ${avatarText} profile picture`;
71 const url = await generateProfilePicture(prompt);
76 };
77
78 fetchProfilePicture();
79 }, [imageUrl, packageId, avatarText, isLoading, profileImage]);
80

untitled-1852index.ts1 match

@Gj64•Updated 1 week ago
553
554// Export the Hono app
555export default app.fetch;

untitled-1852index.html7 matches

@Gj64•Updated 1 week ago
418 formData.append('file', currentLdocFile);
419
420 const response = await fetch('/api/view', {
421 method: 'POST',
422 body: formData
452 formData.append('file', currentLdocFile);
453
454 const response = await fetch('/api/extract', {
455 method: 'POST',
456 body: formData
485 formData.append('file', currentLdocFile);
486
487 const response = await fetch('/api/info', {
488 method: 'POST',
489 body: formData
521 }
522
523 const response = await fetch('/api/encode', {
524 method: 'POST',
525 body: formData
622 formData.append('path', file.path);
623
624 const response = await fetch('/api/view/file', {
625 method: 'POST',
626 body: formData
658 fileViewer.appendChild(loading);
659
660 // Fetch file content
661 const formData = new FormData();
662 formData.append('file', currentLdocFile);
663 formData.append('path', file.path);
664
665 const response = await fetch('/api/view/file', {
666 method: 'POST',
667 body: formData

NPLLMSearchPage.tsx6 matches

@wolf•Updated 1 week ago
17const generateProfilePicture = async (prompt: string): Promise<string> => {
18 try {
19 const response = await fetch(
20 'https://stevekrouse--411c225025f011f0ad23569c3dd06744.web.val.run/api/fal/proxy',
21 {
57 const [profilePictures, setProfilePictures] = useState<ProfilePictureCache>({});
58
59 const fetchPackages = async (
60 searchQuery: string,
61 pageNum: number,
106 setLoading(false);
107 } catch (error) {
108 console.error("Error fetching packages:", error);
109 setLoading(false);
110 }
116 setPage(1);
117 setItems([]);
118 fetchPackages(query.trim(), 1);
119 }
120 };
124 const nextPage = page + 1;
125 setPage(nextPage);
126 fetchPackages(query, nextPage, true);
127 };
128
129 useEffect(() => {
130 fetchPackages(query, 1);
131 }, []);
132

NPLLMsystem_prompt.txt3 matches

@wolf•Updated 1 week ago
235
236 // Inject data to avoid extra round-trips
237 const initialData = await fetchInitialData();
238 const dataScript = `<script>
239 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
283
2845. **API Design:**
285 - `fetch` handler is the entry point for HTTP vals
286 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
287
2886. **Module System:**

NPLLMBranchSelect.tsx1 match

@wolf•Updated 1 week ago
32 return;
33 }
34 branches.refetch();
35 if (res?.branch?.id) {
36 navigate(`/chat/${projectId}/branch/${res.branch.id}`);

NPLLMChatRoute.tsx8 matches

@wolf•Updated 1 week ago
44 files={project.data?.files}
45 branchId={branchId}
46 refetch={project.refetch}
47 />
48 </>
54 files,
55 branchId,
56 refetch,
57}: {
58 project: any;
59 files: any[];
60 branchId: string;
61 refetch: () => void;
62}) {
63 const [images, setImages] = useState<(string | null)[]>([]);
88 if (!messages?.length) return;
89 let last = messages.at(-1);
90 if (shouldRefetch(last)) {
91 refetch();
92 }
93 }, [messages]);
163}
164
165function shouldRefetch(message) {
166 for (let i = 0; i < message?.parts?.length; i++) {
167 let part = message.parts[i];
170 case "str_replace_editor":
171 if (part.toolInvocation?.args?.command === "create") {
172 // console.log("REFETCH (create)");
173 return true;
174 }
176 case "delete_file":
177 case "change_val_type":
178 // console.log("REFETCH (change type or delete)");
179 return true;
180 }

fetch_template2 file matches

@gwoods22•Updated 17 hours ago

HN-fetch-call3 file matches

@ImGqb•Updated 1 day ago
fetch HackerNews by API