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=555&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 8300 results for "fetch"(923ms)

movieMashupmain.tsx1 match

@dthyresson•Updated 7 months ago
21movieMashupsViewRoute(app);
22movieNewMashupMashupRoute(app);
23export default app.fetch;

searchManifoldMarketsmain.tsx2 matches

@adjacent•Updated 7 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3type Market = {
6};
7export async function searchManifoldMarkets(query: string) {
8 const result = await fetch(
9 `https://manifold.markets/api/v0/search-markets?${query}`,
10 );

rabbitstreammain.tsx2 matches

@tempdev•Updated 7 months ago
29 getSourcesParams.append("b", browserid);
30 console.log(getSourcesParams);
31 const result = await fetch(
32 `https://rabbitstream.net/ajax/v2/embed-4/getSources?${getSourcesParams.toString()}`,
33 {
49});
50
51export default app.fetch;

rabbitstreamUtilsmain.tsx2 matches

@tempdev•Updated 7 months ago
39}
40export async function getMeta(id) {
41 const req = await fetch(`https://rabbitstream.net/v2/embed-4/${id}?z=`, {
42 headers: {
43 "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0",
55}
56export async function getWasm() {
57 const req = await fetch("https://rabbitstream.net/images/loading.png?v=0.6", {
58 "headers": {
59 "Referrer-Policy": "strict-origin-when-cross-origin",

WundergroundStationDisplayV2main.tsx8 matches

@Croniac•Updated 7 months ago
1// This approach will fetch weather data from a Wunderground API, parse the JSON response,
2// and display a simplified version of the current conditions in separate tiles. We'll use
3// the fetch API to make the HTTP request and React for rendering the UI.
4
5/** @jsxImportSource https://esm.sh/react */
27
28 useEffect(() => {
29 const fetchWeather = () => {
30 setLastChecked(new Date());
31 fetch("/api/weather" + window.location.search)
32 .then(response => response.json())
33 .then(data => {
41 };
42
43 fetchWeather(); // Fetch immediately on load
44
45 const intervalId = setInterval(() => {
46 if (consecutiveErrors < 5) {
47 fetchWeather();
48 } else {
49 setError("Too many errors occurred. Updates paused. Please refresh the page to try again.");
183 if (url.pathname === "/api/weather") {
184 try {
185 const wundergroundResponse = await fetch(
186 `https://api.weather.com/v2/pws/observations/current?stationId=${stationId}&format=json&units=e&apiKey=e1f10a1e78da46f5b10a1e78da96f525`,
187 );
212 });
213 } catch (error) {
214 return new Response(JSON.stringify({ error: "Failed to fetch weather data" }), {
215 status: 400,
216 headers: { "Content-Type": "application/json" },

jsonToDalleFormmain.tsx1 match

@weaverwhale•Updated 7 months ago
22
23 try {
24 const response = await fetch("/generate", {
25 method: "POST",
26 headers: {

umbrellaRemindermain.tsx2 matches

@therealarkin•Updated 7 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3import { nominatimSearch } from "https://esm.town/v/stevekrouse/nominatimSearch";
4import { weatherGovGrid } from "https://esm.town/v/stevekrouse/weatherGovGrid";
14 lon,
15 });
16 let { properties: { periods } } = await fetchJSON(
17 grid.forecastHourly,
18 );

hackerNewsDigestmain.tsx8 matches

@yasarcelep•Updated 7 months ago
3import { email } from "https://esm.town/v/std/email";
4
5async function fetchStories(type: string, count: number) {
6 const response = await fetch(`https://hacker-news.firebaseio.com/v0/${type}stories.json`);
7 const storyIds = await response.json();
8 const stories = await Promise.all(
9 storyIds.slice(0, count).map(async (id: number) => {
10 const storyResponse = await fetch(`https://hacker-news.firebaseio.com/v0/item/${id}.json`);
11 return storyResponse.json();
12 }),
120export default async function server(req: Request) {
121 try {
122 const topStories = await fetchStories("top", 10);
123 const newStories = await fetchStories("new", 5);
124 const showStories = await fetchStories("show", 3);
125 const askStories = await fetchStories("ask", 3);
126 const jobStories = await fetchStories("job", 3);
127
128 const emailContent = createEmailContent(topStories, newStories, showStories, askStories, jobStories);

quotableApiProxymain.tsx2 matches

@johndturn•Updated 7 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export default async function proxy(req: Request) {
4 const resp = await fetch(
5 "http://api.quotable.io/quotes/random?limit=1",
6 );

telegrambotmain.tsx2 matches

@begoon•Updated 7 months ago
16async function POST(cmd: string, data: { [key: string]: string }) {
17 const url = BOT + "/" + cmd;
18 return await (await fetch(
19 url,
20 {
27
28async function GET(cmd: string) {
29 return await (await fetch(BOT + "/" + cmd)).json();
30}
31

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago