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=633&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 8300 results for "fetch"(833ms)

honoHtmxJsTemplatemain.tsx1 match

@tfayyaz•Updated 11 months ago
38});
39
40export default app.fetch;

honoTanaEndpointmain.tsx1 match

@impedivity•Updated 11 months ago
33 });
34
35 return app.fetch(req);
36};

tanaSavemain.tsx1 match

@impedivity•Updated 11 months ago
29 });
30
31 return app.fetch(req);
32};

hitCounterREADME.md5 matches

@triptych•Updated 11 months ago
1Create a simple hit counter that you can attach to any website via fetch .
2
3I created a web component to use this :
9 this.attachShadow({ mode: 'open' });
10 this.count = 0;
11 this.fetchCount();
12 }
13
14 fetchCount() {
15 fetch('https://triptych-hitcounter.web.val.run/')
16 .then(response => response.json())
17 .then(data => {
19 this.render();
20 })
21 .catch(error => console.error('Error fetching count:', error));
22 }
23

orangeVolemain.tsx4 matches

@yawnxyz•Updated 11 months ago
79const getContent = async (url: string) => {
80 try {
81 const response = await fetch(`https://r.jina.ai/${url}`);
82 if (!response.ok) {
83 throw new Error(`HTTP error! Status: ${response.status}`);
86 return data;
87 } catch (error) {
88 console.error('Error fetching the URL:', error);
89 return 'Error fetching the content.';
90 }
91};
129});
130
131export default app.fetch;
132

openAIHonoChatStreamExamplemain.tsx2 matches

@yawnxyz•Updated 11 months ago
200app.get('/test', (c) => c.html(htmlContent2));
201
202export default app.fetch; // val.town
203// Deno.serve(app.fetch); // deno.deploy
204

myspacemain.tsx2 matches

@triptych•Updated 11 months ago
2import { Hono } from "npm:hono@3";
3
4// TODO: Fetch from key-value
5const profile = {
6 displayName: "Jordan",
169app.get("/", (c) => c.html(myspaceHtml(profile)));
170
171export default app.fetch;

valTownChatGPTmain.tsx1 match

@stevekrouse•Updated 11 months ago
133 return new Response(body, { headers: { "Content-Type": "text/event-stream" } });
134});
135export default app.fetch;

htmxCounterExamplemain.tsx1 match

@yawnxyz•Updated 11 months ago
75});
76
77export default app.fetch;

openAIStreamingREADME.md2 matches

@maxm•Updated 11 months ago
10assistant > Here are a few fun Val ideas you could build on Val Town:
11
121. **Random Joke Generator:** Fetch a random joke from an API and display it.
132. **Daily Weather Update:** Pull weather data for your location using an API and create a daily summary.
143. **Mini Todo List:** Create a simple to-do list app with add, edit, and delete functionalities.
154. **Chuck Norris Facts:** Display a random Chuck Norris fact sourced from an API.
165. **Motivational Quote of the Day:** Fetch and display a random motivational quote each day.
17
18Which one sounds interesting to you?

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago