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=748&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 8150 results for "fetch"(2429ms)

postToMastodonmain.tsx2 matches

@sebdd•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export function postToMastodon(mastodonApiUrl, mastodonAccessToken, status) {
4 return fetch(
5 `${mastodonApiUrl}/statuses?access_token=${mastodonAccessToken}`,
6 {

kaiterra_prometheusmain.tsx3 matches

@tehmantra•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3// Fetches air quality sensor data from Kaiterra in prometheus line format
4export async function kaiterra_prometheus(
5 req: express.Request,
7) {
8 let id = req.query.id;
9 let kiosk_res = await fetch(
10 `https://dashboard.kaiterra.com/v1/account/me/kiosk/data/v2/${id}`,
11 );

postWebhookTestmain.tsx2 matches

@ggarnhart•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let postWebhookTest = fetchJSON(
4 "https://api.val.town/express/@ggarnhart.citiBikeSpotChecker",
5 {

usgsSitemain.tsx2 matches

@eczajk•Updated 1 year ago
1import { fetchXML } from "https://esm.town/v/stevekrouse/fetchXML?v=3";
2
3export async function usgsSite(site) {
4 const result = await fetchXML(
5 `http://waterservices.usgs.gov/nwis/iv/?site=${site}`
6 );

createQdrantCollectionmain.tsx2 matches

@wilt•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3/**
11}) {
12 const { collectionName, qdrantKey, qdrantUrl } = args;
13 const resp = await fetch(
14 `https://${qdrantUrl}/collections/${collectionName}`,
15 {

sendRandomChihuahuaToSlackmain.tsx3 matches

@metart43•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
3
6 "https://dog.ceo/api/breed/chihuahua/images/random",
7 );
8 const dogApiResp = await fetch(dogAPIURL.href);
9 const { message } = await dogApiResp.json();
10 const res = await fetch(process.env.BROOKLAND_SLACK_WEBHOOK_URL, {
11 method: "POST",
12 body: JSON.stringify({

isMyWebsiteDownmain.tsx3 matches

@sdan•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const isMyWebsiteDown = async () => {
8 console.log("hi there");
9 try {
10 const res = await fetch(URL);
11 if (res.status !== 200) {
12 reason = `(status code: ${res.status})`;
15 }
16 catch (e) {
17 reason = `couldn't fetch: ${e}`;
18 ok = false;
19 }

valToStringmain.tsx2 matches

@sdan•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function valToString(val: string) {
6 }
7 const [author, name] = val.split(".");
8 const resp = await fetch(`https://api.val.town/v1/alias/${author}/${name}`);
9 if (resp.status !== 200) {
10 throw new Error(resp.statusText);

measureValTownE2emain.tsx3 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3// E.g. from a user's perspective (not the real execution time!)
8 for (let i = 0; i < count; i++) {
9 let start = Date.now();
10 await fetch("https://api.val.town/eval/(()=%3E1+1)()");
11 evalTimes.push(Date.now() - start);
12 }
23 for (let i = 0; i < count; i++) {
24 let start = Date.now();
25 await fetch("https://api.val.town/eval/@healeycodes.addOnes()");
26 userFuncTimes.push(Date.now() - start);
27 }

githubFollowingmain.tsx3 matches

@tmcw•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Github following!
4export let githubFollowing = (() => {
5 throw new Error(`${fetchJSON.impl.toString()}`);
6 return fetchJSON(
7 "https://api.github.com/users/stevekrouse/following"
8 );

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago