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=1181&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 13573 results for "fetch"(2952ms)

isMyWebsiteDownmain.tsx2 matches

@omaismoe•Updated 1 year ago
12 let reason: string;
13 try {
14 const res = await fetch(URL, { redirect: "follow" });
15 if (res.status !== 200) {
16 reason = `(status code: ${res.status})`;
18 }
19 } catch (e) {
20 reason = `couldn't fetch: ${e}`;
21 ok = false;
22 }

dataURL_examplemain.tsx1 match

@vladimyr•Updated 1 year ago
9console.log(dataURL1);
10
11const resp = await fetch(dataURL1);
12const text = await resp.text();
13console.assert(resp.headers.get("content-type") === "text/plain");

frequencyDotPlotmain.tsx1 match

@stevekrouse•Updated 1 year ago
23});
24
25export default app.fetch;

gsheet_callmain.tsx2 matches

@ynonp•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const gsheet_call = async (service_account, sheet_id, method, action, data) => {
9 };
10 const token = await getToken(service_account, googleAuthOptions);
11 const result = fetchJSON(
12 `https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/${action}`,
13 {

bookmarkmain.tsx1 match

@crif•Updated 1 year ago
78});
79
80export default app.fetch;

pdfExamplemain.tsx1 match

@crif•Updated 1 year ago
41 });
42 });
43 return app.fetch(req);
44});

dailyDadJokemain.tsx2 matches

@LukieKang•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({
7 text: punchline,

bookmarkmain.tsx1 match

@upbound_web•Updated 1 year ago
78});
79
80export default app.fetch;

yellowBonobomain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import { discordFetch } from "https://esm.town/v/vtdocs/discordFetch?v=10";
2
3const recipientId = "420257368417239041";
6const botToken = Deno.env.get("discordBot");
7
8const DM = await discordFetch(
9 botToken,
10 "/users/@me/channels",
16console.log(DM);
17// Then, we send a message via the DM
18const result = await discordFetch(
19 botToken,
20 `/channels/${DM.id}/messages`,

dream_interpretermain.tsx4 matches

@nwcphd•Updated 1 year ago
73
74 // Send the POST request
75 const response = await fetch("https://dreaminterpreteraibackend.com/dream", {
76 method: "POST",
77 headers: {
87 "Sec-Ch-Ua-Mobile": "?0",
88 "Sec-Ch-Ua-Platform": "\"macOS\"",
89 "Sec-Fetch-Dest": "empty",
90 "Sec-Fetch-Mode": "cors",
91 "Sec-Fetch-Site": "cross-site",
92 "Uid": randomUuid(),
93 "User-Agent":

FetchBasic2 file matches

@ther•Updated 5 hours ago

GithubPRFetcher

@andybak•Updated 3 days ago