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=1119&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 15961 results for "fetch"(13421ms)

MalawianNewsTrackermain.tsx2 matches

@nkhuwera•Updated 4 months ago
25 for (const source of NEWS_SOURCES) {
26 try {
27 const response = await fetch(source);
28 const html = await response.text();
29
64 }
65 } catch (sourceError) {
66 console.error(`Error fetching news from ${source}: ${sourceError}`);
67 }
68 }

resourcefulPurpleBobolinkmain.tsx1 match

@harsha_5870•Updated 4 months ago
11 e.preventDefault();
12 try {
13 const result = await fetch("/process", {
14 method: "POST",
15 body: JSON.stringify({ query })

reactHonoExampleMessageInput.tsx1 match

@sophiehouser•Updated 4 months ago
11
12 try {
13 const response = await fetch("/messages", {
14 method: "POST",
15 headers: { "Content-Type": "application/json" },

reactHonoExampleindex.ts2 matches

@sophiehouser•Updated 4 months ago
60});
61
62// HTTP vals expect an exported "fetch handler"
63// This is how you "run the server" in Val Town with Hono
64export default app.fetch;

reactHonoExampleApp.tsx4 matches

@sophiehouser•Updated 4 months ago
9 const [messages, setMessages] = React.useState(initialMessages);
10
11 const fetchMessages = async () => {
12 try {
13 const response = await fetch("/messages");
14 const data = await response.json();
15 setMessages(data.reverse());
16 } catch (error) {
17 console.error("Failed to fetch messages", error);
18 }
19 };
23 <h1>💬 Message Board</h1>
24 <MessageList messages={messages} />
25 <MessageInput onSubmit={fetchMessages} />
26 {thisProjectURL
27 ? (

cerebras_coderindex1 match

@jssongbd•Updated 4 months ago
5async function servePublicFile(path: string): Promise<Response> {
6 const url = new URL("./public/" + path, import.meta.url);
7 const text = await (await fetch(url, {
8 headers: {
9 "User-Agent": "", // to transpile TS to JS

cerebras_coderindex1 match

@jssongbd•Updated 4 months ago
181
182 try {
183 const response = await fetch("/", {
184 method: "POST",
185 body: JSON.stringify({

incredibleBrownEarwigmain.tsx3 matches

@HTKhan7•Updated 4 months ago
162 const handleVoiceInput = async (transcript) => {
163 try {
164 const response = await fetch("/generate", {
165 method: "POST",
166 body: JSON.stringify({
207 window.speechSynthesis.speak(utterance);
208 } else {
209 fetch("/speak", {
210 method: "POST",
211 body: JSON.stringify({ text }),
318 }`;
319
320 const ttsResponse = await fetch(ttsUrl, {
321 headers: {
322 "User-Agent":

AkhilAimain.tsx1 match

@Akhil_23•Updated 4 months ago
38
39 try {
40 const response = await fetch("/chat", {
41 method: "POST",
42 body: JSON.stringify({ messages: newMessages, mode }),

sqliteExplorerAppmain.tsx4 matches

@datsmyname•Updated 4 months ago
1/** @jsxImportSource npm:hono/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

manual-fetcher

@miz•Updated 1 week ago

fake-https1 file match

@blazemcworld•Updated 2 weeks ago
simple proxy to fetch http urls using https