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=228&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 2383 results for "fetch"(330ms)

cerebras_coderindex1 match

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

trmnl_pluginsweather.ts2 matches

@camflan•Updated 2 months ago
12 url.searchParams.set("q", location);
13
14 const response = await fetch(url);
15 return response.json() as unknown as CurrentConditionsResponse;
16};
27 url.searchParams.set("q", location);
28
29 const response = await fetch(url);
30 const json = await response.json();
31 return json as unknown as ForecastResponse;

tsEvalindexPage2 matches

@tmcw•Updated 2 months ago
7
8 if (url.pathname === "/worker.ts") {
9 const js = await (await fetch("https://esm.town/v/maxm/codemirrorTs/worker")).text();
10 return new Response(js, {
11 headers: {
43console.log("loading sdk")
44const vt = new ValTown();
45console.log("Fetching me")
46const me = await vt.me.profile.retrieve();
47console.log(me)

SideProjectSaturdayindex.tsx1 match

@justbe•Updated 2 months ago
137});
138
139export default app.fetch;

emailToDiscorddiscordClient1 match

@wilt•Updated 2 months ago
6
7export async function sendWithRateLimit(url: string, init: RequestInit): Promise<Response> {
8 const resp = await fetch(url, init);
9 if (resp.status === 429) {
10 const retryAfter = resp.headers.get("Retry-After");
status_status

status_statusaws-proxy3 matches

@maxm•Updated 2 months ago
159</html>`;
160
161async function fetchFeed(url: string) {
162 const response = await fetch(url);
163 const xml = await response.text();
164 const feed = await parse(xml);
213
214export default async function handler(req: Request): Promise<Response> {
215 const feedResults = await Promise.all(FEEDS.map(fetchFeed));
216 const content = generateStatusHTML(feedResults);
217 const timestamp = new Date().toLocaleString();

status_statusaws-proxy4 matches

@charmaine•Updated 2 months ago
158</html>`;
159
160async function fetchFeed(url: string) {
161 try {
162 const response = await fetch(url);
163 const xml = await response.text();
164 const feed = await parse(xml);
168 };
169 } catch (error) {
170 console.error(`Error fetching ${url}:`, error);
171 return {
172 title: url,
221
222export default async function handler(req: Request): Promise<Response> {
223 const feedResults = await Promise.all(FEEDS.map(fetchFeed));
224 const content = generateStatusHTML(feedResults);
225 const timestamp = new Date().toLocaleString();

orbiterHealthmonitor3 matches

@stevedylandev•Updated 2 months ago
10async function notifySlack(message: string) {
11 try {
12 await fetch(WEBHOOK_URL, {
13 method: "POST",
14 headers: {
29 const start = performance.now();
30 try {
31 const res = await fetch(url);
32 end = performance.now();
33 status = res.status;
40 } catch (e) {
41 end = performance.now();
42 reason = `couldn't fetch: ${e}`;
43 ok = false;
44 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);

codemirrorTsdemo1 match

@tmcw•Updated 2 months ago
8 // if this script is not on that domain. Proxy it.
9 if (u.pathname === "/worker.ts") {
10 const js = await (await fetch(import.meta.resolve("./worker"), {
11 headers: {
12 "User-Agent": "None",

InstantQueryApp1 match

@vawogbemi•Updated 2 months ago
25 const query = JSON.parse(results!);
26
27 // In a real application, you would use the query to fetch data from the database
28 // For this example, we'll just return the query itself
29 return new Response(JSON.stringify({ query, results: "Sample results would go here" }), {

fetchPaginatedData2 file matches

@nbbaier•Updated 4 days ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago