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=96&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 8602 results for "fetch"(1652ms)

srcbackendmain.tsx12 matches

@temptemp•Updated 2 weeks ago
1import { fetch as ProxyFetcherBase } from "https://esm.town/v/std/fetch";
2import { customAlphabet } from "npm:nanoid";
3const nanoid = customAlphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", 10);
21}
22
23export async function Fetcher(url: string, referer: string) {
24 const design = `?destination=${encodeURIComponent(url)}&referer=${encodeURIComponent(referer)}`;
25 const request = await fetch(
26 `https://1fd98a05-4959-42bc4-2f83-2c487c1cde6d.cloudflarepreviews.com/${design}`,
27 {
34}
35
36export async function ProxyFetcher(url: string, referer: string) {
37 const request = await ProxyFetcherBase("https://do7go.com/e/bv7ib7rrwx3x");
38 return request.text();
39}
60 };
61 const baseUrl = "https://streamwish.com";
62 const embed = await Fetcher(`${baseUrl}/e/${id}`, baseUrl);
63 const pr = /p}\('(.*?)',(\d+),(\d+),'(.*?)'\.split/gm;
64 const ps = /sources:\[{file:\"(.*?)\"/gm;
92 };
93 const baseUrl = "https://do7go.com";
94 const doodData = await ProxyFetcher(`${baseUrl}/e/${id}`, baseUrl);
95 await uploadToIndex(doodData);
96 const poster = "";
99 const thumbnailTrack = `https:${doodData.match(/thumbnails:\s\{\s*vtt:\s'([^']*)'/)?.[1]}`;
100 console.log(`${baseUrl}/pass_md5${path}`);
101 const doodPage = await ProxyFetcher(`${baseUrl}/pass_md5${path}`, `${baseUrl}/e/${id}`);
102 console.log(doodPage);
103 returnData.extractedURL = `${doodPage}${nanoid()}?token=${dataForLater}&expiry=${Date.now()}`;
121
122 try {
123 const uploadHashReq = await fetch(`https://anondrop.net/initiateupload?filename=data.json&key=${key}`, {
124 method: "GET",
125 });
126 const sessionHash = await uploadHashReq.text();
127 const upload = await fetch(
128 `https://anondrop.net/uploadchunk?session_hash=${sessionHash}`,
129 {
137 }
138
139 const newUrl = await fetch(`https://anondrop.net/endupload?session_hash=${sessionHash}`);
140 console.log("Upload successful!");
141 console.log("Download link:", await newUrl.text());
159 };
160 const baseUrl = "https://streamtape.com";
161 const embed = await Fetcher(`${baseUrl}/e/${id}`, "");
162 const match = embed.match(/robotlink'\)\.innerHTML = '(.*)'/);
163 if (!match) throw new Error("No match found");

JaanWebsiteStatusmonitor2 matches

@Jaan•Updated 2 weeks ago
15 const start = performance.now();
16 try {
17 res = await fetch(url);
18 end = performance.now();
19 status = res.status;
25 } catch (e) {
26 end = performance.now();
27 reason = `couldn't fetch: ${e}`;
28 ok = false;
29 }

fieryLavenderVultureindex.ts5 matches

@temptemp•Updated 2 weeks ago
46
47 try {
48 const uploadHashReq = await fetch(`https://anondrop.net/initiateupload?filename=data.json&key=${key}`, {
49 method: "GET",
50 });
51 const sessionHash = await uploadHashReq.text();
52 const upload = await fetch(
53 `https://anondrop.net/uploadchunk?session_hash=${sessionHash}`,
54 {
62 }
63
64 const newUrl = await fetch(`https://anondrop.net/endupload?session_hash=${sessionHash}`);
65 console.log("Upload successful!");
66 console.log("Download link:", await newUrl.text());
95
96app.get("/p/:slug", async (c) => {
97 // DB FETCH
98 return c.html(
99 `<h1>Hello Poster!</h1>`,
102});
103
104export default app.fetch;

kroger-price-trackerkrogerClient3 matches

@nickrobinson•Updated 2 weeks ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function fetchProductPrices() {
4 const res = await fetchJSON(
5 `https://chrome.browserless.io/scrape?token=${Deno.env.get("browserless")}`,
6 {

kroger-price-trackerimportPrices2 matches

@nickrobinson•Updated 2 weeks ago
1import { fetchProductPrices } from "./krogerClient";
2
3export default async function(interval: Interval) {
5 "0005150025516",
6 ];
7 const prices = await fetchProductPrices();
8 console.log(prices);
9}

MiniHabitTrackermain.tsx7 matches

@liciacodes•Updated 2 weeks ago
8
9 useEffect(() => {
10 fetchHabits();
11 }, []);
12
13 const fetchHabits = async () => {
14 const response = await fetch("/habits");
15 const data = await response.json();
16 setHabits(data);
21 if (!newHabit.trim()) return;
22
23 const response = await fetch("/habits", {
24 method: "POST",
25 headers: { "Content-Type": "application/json" },
28
29 if (response.ok) {
30 fetchHabits();
31 setNewHabit("");
32 }
34
35 const toggleHabitCompletion = async (habitId) => {
36 const response = await fetch(`/habits/${habitId}/complete`, { method: "POST" });
37 if (response.ok) {
38 fetchHabits();
39 }
40 };

uniqueSilverHorsemain.tsx2 matches

@idoubtit_0815•Updated 2 weeks ago
76
77 try {
78 const response = await fetch('/setToken', {
79 method: 'POST',
80 headers: {
158
159 // Send echo response back to same chat
160 const response = await fetch(`https://api.telegram.org/bot${BOT_TOKEN}/sendMessage`, {
161 method: "POST",
162 headers: {

gloriousPinkManateemain.tsx1 match

@Judith_123•Updated 2 weeks ago
1import process from "node:process";
2
3const res = await fetch("https://api.val.town/v1/me", {
4 headers: {
5 Authorization: `Bearer ${process.env.valtown}`,

sqliteExplorerAppmain.tsx4 matches

@alexmnps•Updated 2 weeks ago
1/** @jsxImportSource npm:hono/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

finalRoundFeedmain.tsx4 matches

@gabrieledarrigo•Updated 2 weeks ago
38const bot = new Bot(TELEGRAM_TOKEN);
39
40async function fetchRSSFeed(): Promise<RSS> {
41 const response = await fetch(RSS_FEED_URL);
42 const text = await response.text();
43
85
86export default async function(interval: Interval) {
87 console.log("Fetching RSS feed...");
88
89 const { rss } = await fetchRSSFeed();
90
91 const lastRunAt = interval.lastRunAt || new Date();

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago