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=713&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 8352 results for "fetch"(2515ms)

handleGroupmeMessagemain.tsx3 matches

@tjnoe•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
3
7) {
8 const getRandomRhyme = async (word: string) => {
9 const rhymeRes = await fetch(
10 `https://api.datamuse.com/words?rel_rhy=${word}`,
11 );
20 };
21 const sendGroupmeMessage = async (bot_id: string, text: string) => {
22 const response = await fetch("https://api.groupme.com/v3/bots/post", {
23 method: "POST",
24 headers: {

testFilteringCommentsValmain.tsx5 matches

@willthereader•Updated 1 year ago
1import { ConstructReadTangleUrl } from "https://esm.town/v/willthereader/ConstructReadTangleUrl";
2import { fetchComments } from "https://esm.town/v/willthereader/fetchComments";
3import { FilterCommentsVal } from "https://esm.town/v/willthereader/FilterCommentsVal";
4import { logMessage } from "https://esm.town/v/willthereader/logMessage";
11 // Construct the URL with the desired parameters
12 const url = ConstructReadTangleUrl({ post_id: "6525827c68f969000134e052" });
13 // Fetch the comments using the constructed URL
14 logMessage("info", "Fetching comments from the server");
15 const comments = await fetchComments(url);
16 // Now filter the fetched comments
17 const filteredComments = await FilterCommentsVal.filterComments(
18 comments,

untitled_aquaBirdmain.tsx3 matches

@pdlieber•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4function fetchRandomJoke() {
5 const SAMPLE_JOKE = {
6 "setup": "What do you call a group of disorganized cats?",
10}
11
12const randomJoke = fetchRandomJoke();
13const setup = randomJoke.setup;
14const punchline = randomJoke.punchline;

bilibili_methodsmain.tsx2 matches

@rebelpotato•Updated 1 year ago
23
24export function get_bilibili(url, cookie) {
25 return fetch(url, {
26 method: "GET",
27 credentials: "include",
44
45export function post_bilibili(url, post_data, cookie) {
46 return fetch(url, {
47 method: "POST",
48 credentials: "include",

untitled_blushLobstermain.tsx4 matches

@anniepeak•Updated 1 year 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;

weatherGPTmain.tsx2 matches

@treb0r•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=11";
2import { fetch } from "https://esm.town/v/std/fetch";
3import { OpenAI } from "npm:openai";
4
5let location = "Halifax UK";
6let lang = "en";
7const weather = await fetch(
8 `https://wttr.in/${location}?2?lang=${lang}&format=j1`,
9).then(r => r.json());

untitled_coffeeMacawmain.tsx5 matches

@shaniehurvitz•Updated 1 year ago
6import { email } from "https://esm.town/v/std/email?v=9";
7
8// Fetches a random joke.
9// Fetches a random joke.
10async function fetchRandomJoke() {
11 const response = await fetch(
12 "https://official-joke-api.appspot.com/random_joke",
13 );
15}
16
17const randomJoke = await fetchRandomJoke();
18const setup = randomJoke.setup;
19const punchline = randomJoke.punchline;

weatherGPTmain.tsx2 matches

@ellenchisa•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=11";
2import { fetch } from "https://esm.town/v/std/fetch";
3import { OpenAI } from "npm:openai";
4
5let location = "san francisco ca";
6let lang = "en";
7const weather = await fetch(
8 `https://wttr.in/${location}?2?lang=${lang}&format=j1`,
9).then(r => r.json());

emailRandomJokemain.tsx4 matches

@liu_david3•Updated 1 year 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;

untitled_purpleApemain.tsx2 matches

@phoebedrouin•Updated 1 year ago
4};
5
6function fetchRandomJoke() {
7 const SAMPLE_JOKE = {
8 "setup": "What is the best way to explore Italy?",
13}
14
15const randomJoke = fetchRandomJoke();
16const setup = randomJoke.setup;
17const punchline = randomJoke.punchline;

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago