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/$%7Burl%7D?q=fetch&page=676&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 9115 results for "fetch"(2048ms)

compileAndUploadTinygoWasmmain.tsx2 matches

@kora•Updated 9 months ago
42})();
43
44let resp = await fetch("https://maxm-wasmBlobHost.web.val.run", {
45 method: "POST",
46 headers: {
57
58import { wasmHandler } from "https://esm.town/v/maxm/tinygoHttp";
59const resp = await fetch("${url}");
60const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer()));
61export default async function(req: Request): Promise<Response> {

coffeeReptilemain.tsx1 match

@tempguy•Updated 9 months ago
1import { blob } from "https://esm.town/v/std/blob?v=12";
2export default async function(interval: Interval) {
3 await fetch("https://tempguy-scarletsole.web.val.run/refresh");
4 const date = new Date();
5 await blob.setJSON("turnstileCron", { ptime: date.getTime(), ntime: interval.delay + interval.lastRunAt.getTime() });

tealPheasantmain.tsx9 matches

@tempguy•Updated 9 months ago
2const url =
3 "https://streambucket.net/playvideo.php?video_id=S0dpVVFEbWV3ZDBBNGI3QldBPT0=&server_id=42&token=S0dLWFR6NkcxTUllNHIzSlRGb0tTaXFTVStiSHNRdkpNcXFsOWtJamljYU5nQ1JId1dac2hVeTN5VGkrRG1ZN2FiSUs0ZU9MUEo1Sk9XcEhUTHJLOUt0cGc0aXZvTGhDUDhRV1IyMGR3Qnl4d0YyNERsQWRhOXBvK2tQanNvODBzc3FOQnVDRjl2UUJDVjJURjFqNjNER202TzJNNUxzcEtnPT0=";
4const req = await fetch(
5 "https://streambucket.net/playvideo.php?video_id=S0dpVVFEbWV3ZDBBNGI3QldBPT0=&server_id=42&token=S0dLWFR6NkcxTUllNHIzSlRGb0tTaXFTVStiSHNRdkpNcXFsOWtJamljYU5nQ1JId1dac2hVeTN5VGkrRG1ZN2FiSUs0ZU9MUEo1Sk9XcEhUTHJLOUt0cGc0aXZvTGhDUDhRV1IyMGR3Qnl4d0YyNERsQWRhOXBvK2tQanNvODBzc3FOQnVDRjl2UUJDVjJURjFqNjNER202TzJNNUxzcEtnPT0=",
6);
25 "Alt-Used": "streambucket.net",
26 "Upgrade-Insecure-Requests": "1",
27 "Sec-Fetch-Dest": "iframe",
28 "Sec-Fetch-Mode": "navigate",
29 "Sec-Fetch-Site": "same-origin",
30 "Sec-Fetch-User": "?1",
31 "Priority": "u=4",
32 "Pragma": "no-cache",
67
68 try {
69 // Perform the fetch request
70 const response = await fetch(url, {
71 method: "POST",
72 headers: headers,
74 });
75
76 // Await and log the result of the fetch request
77 const result = await response.status;
78 console.log(result);
79 } catch (error) {
80 console.error("Error fetching combination:", combination, error);
81 }
82 }

maroonBandicootmain.tsx3 matches

@tempguy•Updated 9 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2export default async function(request: Request) {
3 const url = new URL(request.url);
4 const h = url.searchParams.get("tdestination");
5 if (h) {
6 const resp = await fetch(decodeURIComponent(url.searchParams.get("tdestination")), {
7 method: request.method,
8 body: request.body,
13 }
14 else {
15 const resp = await fetch(decodeURIComponent(url.searchParams.get("destination")), {
16 method: request.method,
17 body: request.body,

glideREADME.md1 match

@dvdsgl•Updated 9 months ago
9## Examples
10
11Simplest case, use `runIngest` with an async `fetch`:
12
13```ts

isMyWebsiteDownmain.tsx2 matches

@rkda•Updated 9 months ago
9 let reason: string;
10 try {
11 const res = await fetch(URL, { redirect: "follow" });
12 if (res.status !== 200) {
13 reason = `(status code: ${res.status})`;
15 }
16 } catch (e) {
17 reason = `couldn't fetch: ${e}`;
18 ok = false;
19 }

aquaAntmain.tsx18 matches

@tempguy•Updated 9 months ago
18 "Accept": "application/json, text/javascript, */*; q=0.01",
19 "Accept-Language": "en-US,en;q=0.5",
20 "Sec-Fetch-Dest": "empty",
21 "Sec-Fetch-Mode": "no-cors",
22 "Sec-Fetch-Site": "same-origin",
23 "X-Requested-With": "XMLHttpRequest",
24 "Priority": "u=4",
28 }
29
30 async fetchPage() {
31 try {
32 const response = await fetch(this.url, { headers: this.headers });
33
34 if (!response.ok) throw new Error(`Failed to fetch page: ${response.statusText}`);
35
36 const $ = cheerio.load(await response.text());
66 if (server.class === "doodstream") {
67 const id = server.video.split("/")[4];
68 const data = await (await fetch(`https://tempguy-scarletsole.web.val.run/dood/${id}`)).json();
69 this.results.sourceC = data.stream[0].qualities.unknown.url;
70 }
79async function extract(url) {
80 try {
81 const response = await fetch(url, {
82 headers: {
83 "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0",
84 "Accept": "application/json, text/javascript, */*; q=0.01",
85 "Accept-Language": "en-US,en;q=0.5",
86 "Sec-Fetch-Dest": "empty",
87 "Sec-Fetch-Mode": "no-cors",
88 "Sec-Fetch-Site": "same-origin",
89 "X-Requested-With": "XMLHttpRequest",
90 "Priority": "u=4",
94 });
95
96 if (!response.ok) throw new Error(`Failed to fetch data: ${response.statusText}`);
97
98 const text = await response.text();
126 }).toString() + _0x249a7e.substr(_0x249a7e.indexOf("&")) + "&alias=" + _0x4d306e;
127
128 const apiResponse = await fetch(api, {
129 headers: {
130 "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0",
131 "Accept": "application/json, text/javascript, */*; q=0.01",
132 "Accept-Language": "en-US,en;q=0.5",
133 "Sec-Fetch-Dest": "empty",
134 "Sec-Fetch-Mode": "no-cors",
135 "Sec-Fetch-Site": "same-origin",
136 "X-Requested-With": "XMLHttpRequest",
137 "Priority": "u=4",
141 });
142
143 if (!apiResponse.ok) throw new Error(`Failed to fetch API: ${apiResponse.statusText}`);
144
145 const apiData = await apiResponse.json();
159(async () => {
160 const scraper = new AnimeScraper("https://anitaku.pe/one-piece-dub-episode-1085");
161 await scraper.fetchPage();
162 await scraper.processServers();
163})();

ReactStream_migratedREADME.md2 matches

@jxnblk•Updated 9 months ago
73```
74
75### Fetch data on the server to set initial props
76
77
79// example middleware
80async function getInitialProps (req: Request, res: Response, next) {
81 // fetch data or do async work to pass as props to the component
82 req.data = {
83 hello: "props",

processTrackBlobsJobREADME.md1 match

@dthyresson•Updated 9 months ago
1# processTracksBlobsJob
2
3Periodically fetch all Spotify tracks from Blob storage and update the `tracks` database with a subset of display information.
4
5Keys take the format: `spotify_track_id:4tVhBXOhSlqYCL2IjyoUNu`.

copperScorpionmain.tsx3 matches

@tempguy•Updated 9 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2export default async function(request: Request) {
3 const url = new URL(request.url);
4 const h = url.searchParams.get("tdestination");
5 if (h) {
6 const resp = await fetch(decodeURIComponent(url.searchParams.get("tdestination")), {
7 method: request.method,
8 body: request.body,
13 }
14 else {
15 const resp = await fetch(decodeURIComponent(url.searchParams.get("destination")), {
16 method: request.method,
17 body: request.body,

proxyFetch2 file matches

@vidar•Updated 9 hours ago

TAC_FetchBasic2 file matches

@A7_OMC•Updated 1 day ago