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/$%7Bsuccess?q=fetch&page=612&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 9506 results for "fetch"(2628ms)

bskymain.tsx1 match

@daisuke•Updated 5 months ago
8 const url = "https://public.api.bsky.app/xrpc/app.bsky.feed.getAuthorFeed?actor=dai.bsky.social&filter=posts_no_replies";
9
10 const data: Feed = await fetch(url).then((r) => r.json());
11
12 return new Response(

encouragingAmethystTickmain.tsx3 matches

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

amicableAquamarinePanthermain.tsx4 matches

@krishad29•Updated 5 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function 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;

CS1200main.tsx4 matches

@timpineda•Updated 5 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
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;

constantTomatoTarantulamain.tsx3 matches

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

CS1200Projmain.tsx5 matches

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

readablemain.tsx1 match

@neverstew•Updated 5 months ago
3
4export default async function(req: Request) {
5 let resp = await fetch(`https://${new URL(req.url).pathname.replace(/^https?:\/\//, '')}`, req);
6 let body = await resp.text();
7 let doc = new JSDOM(body);

uptimemain.tsx7 matches

@vyatka•Updated 5 months ago
10 const start = performance.now();
11 try {
12 const res = await fetch(url, {
13 method: 'GET',
14 headers: { 'User-Agent': 'ValTown Uptime Checker' }
24 } catch (e) {
25 end = performance.now();
26 reason = `couldn't fetch: ${e}`;
27 ok = false;
28 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);
51
52 useEffect(() => {
53 async function fetchUptimeData() {
54 try {
55 const response = await fetch('/uptime-data');
56 const data = await response.json();
57 setUptimeData(data);
58 setLoading(false);
59 } catch (error) {
60 console.error('Failed to fetch uptime data:', error);
61 setLoading(false);
62 }
63 }
64 fetchUptimeData();
65 const interval = setInterval(fetchUptimeData, 60000); // Refresh every minute
66 return () => clearInterval(interval);
67 }, []);

iheartjankboteko1main.tsx4 matches

@iheartjankboteko•Updated 5 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
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;

Jokemain.tsx4 matches

@slothfuldreams•Updated 5 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
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;

agentplex-deal-flow-email-fetch1 file match

@anandvc•Updated 5 hours ago

proxyFetch2 file matches

@vidar•Updated 2 days ago