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=588&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 7881 results for "fetch"(1595ms)

valTownChatGPTmain.tsx2 matches

@maxm•Updated 10 months ago
33
34 // Post the message so we can deal with large text data.
35 await fetch(`/post-message?threadId=${input.getAttribute("data-thread-id")}`, {
36 method: "post",
37 body: msgDiv.textContent,
147 return new Response(body, { headers: { "Content-Type": "text/event-stream" } });
148});
149export default app.fetch;

SidebarToArchivemain.tsx4 matches

@yawnxyz•Updated 10 months ago
1import { Hono } from 'npm:hono';
2import sheet from 'npm:@yawnxyz/sheetlog@0.0.15';
3import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
4import { Sema } from 'npm:async-sema';
5import { modelProvider } from 'https://esm.town/v/yawnxyz/ai';
98 // console.log('gql:', JSON.stringify(gql));
99
100 let results = await fetchJSON(`https://archive.sidebar.io/graphql`, {
101 method: 'POST',
102 headers: {
139 allLinks = allLinks.concat(links);
140 if (links.length < limit) {
141 break; // No more links to fetch
142 }
143 offset += limit;
165
166// Start server
167export default app.fetch;
168
169// let links = await getSidebar(500, 618); // Example usage: limit 10, start from 5

chatGPTmain.tsx1 match

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

resumeConfigmain.tsx1 match

@iamseeley•Updated 10 months ago
5
6export const resumeConfig = {
7 // URL to fetch the resume JSON data. This should point to your raw resume JSON.
8 // If you want to host your resume JSON somewhere I recommend a setup like this on val town (https://www.val.town/v/iamseeley/resumeDetails) or a github gist.
9 // You can test out the resume view using my resume: https://iamseeley-resumedetails.web.val.run

getTweetsmain.tsx6 matches

@geoffreylitt•Updated 10 months ago
16}
17
18// Function to fetch tweets from a user
19export async function getTweets(username: string) {
20 const userUrl = `https://api.twitter.com/2/users/by/username/${username}`;
21 const userResponse = await fetch(userUrl, {
22 headers: {
23 "Authorization": `Bearer ${bearerToken}`,
26
27 if (!userResponse.ok) {
28 console.error("Error fetching user data:", await userResponse.text());
29 return;
30 }
34
35 const tweetsUrl = `https://api.twitter.com/2/users/${userId}/tweets`;
36 const tweetsResponse = await fetch(tweetsUrl, {
37 headers: {
38 "Authorization": `Bearer ${bearerToken}`,
41
42 if (!tweetsResponse.ok) {
43 console.error("Error fetching tweets:", await tweetsResponse.text());
44 return;
45 }
51}
52
53// Replace 'stevekrouse' with the username you want to fetch tweets for
54getTweets("stevekrouse");

sqliteExplorerAppmain.tsx4 matches

@dtkav•Updated 10 months ago
1/** @jsxImportSource https://esm.sh/hono@latest/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";
15import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth?v=70";
16import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
17import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
18import { Hono } from "npm:hono";
19import type { FC } from "npm:hono/jsx";
174});
175
176export const handler = app.fetch;
177export default iframeHandler(modifyFetchHandler(passwordAuth(handler)));

uptimemain.tsx2 matches

@cn_d_•Updated 10 months ago
14 start = performance.now();
15 try {
16 const res = await fetch(url);
17 end = performance.now();
18 status = res.status;
25 } catch (e) {
26 end = performance.now();
27 reason = `couldn't fetch: ${e}`;
28 ok = false;
29 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);

emojiExplodermain.tsx1 match

@iamseeley•Updated 10 months ago
98});
99
100export default app.fetch;
101

semanticSearchmain.tsx1 match

@yawnxyz•Updated 10 months ago
162});
163
164export default app.fetch;
165export { SemanticSearch, semanticSearch };
166

createGeneratedValmain.tsx3 matches

@yawnxyz•Updated 10 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2import { runVal } from "https://esm.town/v/std/runVal";
3import { OpenAI } from "https://esm.town/v/std/openai";
55 );
56
57 const val = await fetchJSON(
58 `https://api.val.town/v1/vals`,
59 {
89console.log(newVal, newVal.name)
90
91// const results = await fetchJSON(`https://yawnxyz-${newVal.name}.web.val.run`);
92// console.log(`--->>>>>>>> https://yawnxyz-${newVal.name}.web.val.run, res);
93

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago