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/$%7Bart_info.art.src%7D?q=fetch&page=1000&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 13283 results for "fetch"(2565ms)

PSEoutagesmain.tsx4 matches

@andreterron•Updated 6 months ago
35}
36
37// ----- fetch or read from file
38
39async function fetchOutages() {
40 const res = await fetch(OUTAGES_URL);
41 const json = await res.json();
42 return json as OutagesJson;
101export async function getOutages() {
102 // const outagesJson = await readOutages();
103 const outagesJson = await fetchOutages();
104
105 // Create check

sqlite_adminmain.tsx1 match

@sitrucl•Updated 6 months ago
10app.get("/", async (c) => c.html(await sqlite_admin_tables()));
11app.get("/:table", async (c) => c.html(await sqlite_admin_table(c.req.param("table"))));
12export default basicAuth(app.fetch, { verifyUser: (_, password) => verifyToken(password) });

enchantingSilverPelicanmain.tsx4 matches

@oscarkong•Updated 6 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4function fetchRandomJoke() {
5 const response = fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

is_omnico_upmain.tsx2 matches

@lukebowerman•Updated 6 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)`);

welcomingAmethystRaccoonmain.tsx4 matches

@carter_vargas•Updated 6 months ago
1// ... imports ...
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

gnews2emailmain.tsx2 matches

@mforonda•Updated 6 months ago
16// --------------------------
17
18async function fetchNews(queries: any, hours: number, lang: string, region: string) {
19 let news;
20 let results = [];
103export default async function(interval: Interval) {
104 try {
105 const results = await fetchNews(queries, hours, lang, region);
106 console.log(`${
107 results.map(q => {

gnewsmain.tsx1 match

@joseforonda•Updated 6 months ago
41 { query, hours, lang, region }: { query: string; hours: number; lang: string; region: string },
42) {
43 const response = await fetch(
44 getFeedUrl(query, hours, lang, region),
45 );

brooklynWeatherFetchermain.tsx4 matches

@jjoak3•Updated 6 months ago
9
10 useEffect(() => {
11 async function fetchWeather() {
12 try {
13 // Los Angeles coordinates with Fahrenheit units
14 const response = await fetch(
15 "https://api.open-meteo.com/v1/forecast?latitude=34.0522&longitude=-118.2437&current=temperature_2m,relative_humidity_2m,wind_speed_10m,weather_code&temperature_unit=fahrenheit&wind_speed_unit=mph&timezone=America%2FLos_Angeles"
16 );
17
18 if (!response.ok) {
19 throw new Error('Weather data fetch failed');
20 }
21
29 }
30
31 fetchWeather();
32 }, []);
33

honoHTMLRendererValmain.tsx1 match

@stevedylandev•Updated 6 months ago
34
35
36export default app.fetch;

isMyWebsiteDownmain.tsx2 matches

@stevedave04•Updated 6 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)`);

GithubPRFetcher

@andybak•Updated 21 hours ago

proxiedfetch1 file match

@jayden•Updated 1 day ago