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=860&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 9065 results for "fetch"(2244ms)

nameTopHNThreadUsingSomeonesValmain.tsx2 matches

@elsif_maj•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3export let nameTopHNThreadUsingSomeonesVal = (async () => {
4 // Cheerio parses markup and provides an API to interact with the resulting data structure
5 const cheerio = await import("npm:cheerio"); // You can import NPM packages
6 const replyText = await fetchText(
7 "https://news.ycombinator.com/",
8 );

proxyFetchmain.tsx5 matches

@alp•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const proxyFetch = async (req, res) => {
4 const { url, options } = req.body;
5 try {
6 const response = await fetch(url, options);
7 return res.status(response.status).send(await response.text());
8 }
9 catch (e) {
10 const errorMessage = e instanceof Error ? e.message : "Unknown error";
11 console.error("Failed to initiate fetch", e);
12 return res.status(500).send(`Failed to initiate fetch: ${errorMessage}`);
13 }
14};

checkStatusmain.tsx3 matches

@louis•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const checkStatus = async (
6): Promise<number> => {
7 try {
8 const response = await fetch(url);
9 console.log(`Fetched ${url}`);
10 const statusCode = response.status;
11 return statusCode;

basicsWithBabishRssmain.tsx2 matches

@diit•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function basicsWithBabishRss(req: express.Request, res) {
10 async function generateRssFeed() {
11 const { parseDocument } = await import("npm:htmlparser2");
12 const response = await fetch("https://basicswithbabish.co/episodes");
13 const body = await response.text();
14 const dom = parseDocument(body);

kpunkShowmain.tsx2 matches

@aeaton•Updated 1 year ago
1import { fetchHtmlDom } from "https://esm.town/v/aeaton/fetchHtmlDom";
2
3export async function kpunkShow(url) {
4 const dom = await fetchHtmlDom(url);
5 const date = dom.querySelector(".postDate")?.textContent.trim();
6 const titleNode = dom.querySelector(".postTitle .postTitle");

etherealExtractormain.tsx2 matches

@zerilliworks•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const etherealExtractor = async function (
20 return res.status(400).send({ message: "email_id is required" });
21 const sourceUrl = `https://ethereal.email/message/${email_id}/message.eml`;
22 const resource = await fetch(sourceUrl);
23 const eml = await resource.text();
24 const headerEndsAt = eml.search(/\n\s+\n/);

starWarsmain.tsx2 matches

@dosirak•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let starWars = fetchJSON(
4 "https://swapi.dev/api/people/1/"
5);

ipmain.tsx2 matches

@ian•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/ian/fetchJSON";
2
3export let ip = await fetchJSON("https://api.ipify.org?format=json ");

gitlabUserContributionEventsmain.tsx2 matches

@rwev•Updated 1 year ago
1import process from "node:process";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export async function gitlabUserContributionEvents(afterDateMs) {
6 console.log(after);
7 // https://docs.gitlab.com/ee/api/events.html#get-user-contribution-events
8 let userEvents = await fetchJSON(
9 `gitlab.com/api/v4/users/rwev/events?after=${after}`,
10 {

duckAndWafflemain.tsx2 matches

@dot•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function duckAndWaffle() {
8 let party_size = "2";
9
10 let response = await fetch(
11 `https://www.sevenrooms.com/api-yoa/availability/widget/range?venue=${venue}&time_slot=${time_slot}&party_size=${party_size}&halo_size_interval=5&start_date=${start_date}&num_days=1&channel=SEVENROOMS_WIDGET`
12 );

proxyFetch2 file matches

@vidar•Updated 2 hours ago

TAC_FetchBasic2 file matches

@A7_OMC•Updated 17 hours ago