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/?q=fetch&page=580&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 8234 results for "fetch"(928ms)

bookTheSperryChaletmain.tsx1 match

@mattrw2•Updated 8 months ago
5
6export default async function(interval: Interval) {
7 const response = await fetch("https://www.sperrychalet.com/vacancy_s.html");
8 const body = await response.text();
9 const $ = cheerio.load(body);

smallwebmain.tsx1 match

@pinjasaur•Updated 8 months ago
1import { DOMParser, Element } from "jsr:@b-fuze/deno-dom";
2
3const getText = async url => (await fetch(url)).text();
4
5export default async function(req: Request): Promise<Response> {

fetchIpfsPostsmain.tsx5 matches

@stevedylandev•Updated 8 months ago
2let endDate = Math.floor(currentDate.getTime() / 1000);
3let startDate = Math.floor(currentDate.setDate(currentDate.getDate() - 7) / 1000);
4export async function fetchIPFSPosts() {
5 try {
6 const soRes = await fetch(
7 `https://api.stackexchange.com/2.3/questions?fromdate=${startDate}&todate=${endDate}&order=desc&sort=creation&tagged=upload&site=stackoverflow`,
8 {
23 });
24
25 const seRes = await fetch(
26 `https://api.stackexchange.com/2.3/questions?fromdate=${startDate}&todate=${endDate}&order=desc&sort=creation&tagged=s3&site=stackoverflow`,
27 {
42 });
43
44 const fileApiRes = await fetch(
45 `https://api.stackexchange.com/2.3/questions?fromdate=${startDate}&todate=${endDate}&order=desc&sort=creation&tagged=fileapi&site=stackoverflow`,
46 )
84 return emailText;
85 } catch (error) {
86 console.error("Error fetching data:", error);
87 return null;
88 }

emailPostsmain.tsx4 matches

@stevedylandev•Updated 8 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetchIPFSPosts } from "https://esm.town/v/stevedylandev/fetchIpfsPosts";
3//import { fetchPinataPosts } from "https://esm.town/v/stevedylandev/fetchPinatsPosts";
4
5//const emailBody1 = await fetchPinataPosts();
6const emailBody2 = await fetchIPFSPosts();
7
8export let emailExample = email({

is_ipaddr_in_Icelandmain.tsx2 matches

@zarutian•Updated 8 months ago
1// original val name: vicariousLavenderDeer
2import { fetch as proxied_fetch } from "https://esm.town/v/std/fetch";
3import ipaddr from "npm:ipaddr.js";
4import dns from "node:dns/promises";
17 const nets_url = (iptala_kind == "ipv4") ? ipv4_nets_url :
18 ((iptala_kind == "ipv6") ? ipv6_nets_url : "");
19 const nets_CIDR_response = await proxied_fetch(nets_url);
20 const nets_CIDR = await nets_CIDR_response.text();
21 return nets_CIDR.split("\n").reduce((acc, item, idx) =>

emailMeWhenBadAirQualitymain.tsx2 matches

@bcongdon•Updated 8 months ago
1import { lastRun } from "https://esm.town/v/logan/lastRun";
2import { fetch } from "https://esm.town/v/std/fetch";
3import { set } from "https://esm.town/v/std/set?v=11";
4import process from "node:process";
14 throw new Error("Must define WEATHER_BIT_API_KEY in secrets");
15 }
16 const res = await fetch(
17 `https://api.weatherbit.io/v2.0/current/airquality?lat=${lat}&lon=${long}&key=${apiKey}`,
18 );

spacex_migratedREADME.md1 match

@moe•Updated 8 months ago
2
3todo:
4- fetch and persist data on regular basis
5- display data from cache
6

featureflagsREADME.md2 matches

@fmac•Updated 8 months ago
25There are two endpoints:
26
27- `/` -- the root endpoint fetches all flags for the given user.
28- `/:id` -- fetches just one flag value, given by `:id`, for the given user.
29
30## Specifying users

featureflagsmain.tsx1 match

@fmac•Updated 8 months ago
112});
113
114export default app.fetch;

FetchBasicREADME.md2 matches

@hunty•Updated 8 months ago
1# Framer Fetch: Basic
2
3A basic example of an API endpoint to use with Framer Fetch.

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago