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/image-url.jpg%20%22Image%20title%22?q=fetch&page=733&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 8693 results for "fetch"(1269ms)

refreshAnimalWidgetmain.tsx2 matches

@crsven•Updated 1 year ago
1import { animalWidgetJson } from "https://esm.town/v/crsven/animalWidgetJson";
2import { fetchABird } from "https://esm.town/v/crsven/fetchABird";
3import { getBirdPhotoUrl } from "https://esm.town/v/crsven/getBirdPhotoUrl";
4import { getNextColorCombo } from "https://esm.town/v/crsven/getNextColorCombo";
6
7export let refreshAnimalWidget = async () => {
8 const bird = await fetchABird();
9 const photoUrl = await getBirdPhotoUrl(
10 `${bird.gen} ${bird.sp}`,

market_kelly_betmain.tsx2 matches

@case•Updated 1 year ago
35
36async function getMarket(slug: string) {
37 const res = await fetch(`https://api.manifold.markets/v0/slug/${slug}`);
38
39 if (!res.ok) {
40 const body = await res.text();
41 throw new Error(body ?? "Error fetching market");
42 }
43

getThreadsActivitymain.tsx1 match

@glommer•Updated 1 year ago
20
21async function getNewThreads() {
22 const resp = await fetch(`https://discord.com/api/guilds/${guild}/threads/active`, {
23 headers: {
24 "Authorization": `Bot ${token}`,

val2imgmain.tsx1 match

@pomdtr•Updated 1 year ago
7 const title = `@${author}/${name}`;
8
9 const resp = await fetch(`https://api.val.town/v1/alias/${author}/${name}`, {
10 headers: {
11 Authorization: `Bearer ${Deno.env.get("valtown")}`,

rpcREADME.md2 matches

@zarutian•Updated 1 year ago
39
40```ts
41const res = await fetch("https://std-rpc_example.web.val.run/?args=[2,3]");
42console.log(await res.json()); // 5
43```
46
47```ts
48const res = await fetch("https://std-rpc_example.web.val.run/", {
49 method: "POST",
50 body: JSON.stringify({ args: [2, 3] })

blogmain.tsx1 match

@pomdtr•Updated 1 year ago
71}
72
73export const blog = app.fetch;
74
75// #blog

emailCourseCreatormain.tsx6 matches

@petermillspaugh•Updated 1 year ago
1import { fetchConfirmationHtml } from "https://esm.town/v/petermillspaugh/fetchConfirmationHtml";
2import { fetchSignupHtml } from "https://esm.town/v/petermillspaugh/fetchSignupHtml";
3import { markLessonComplete } from "https://esm.town/v/petermillspaugh/markLessonComplete";
4import { refreshToken } from "https://esm.town/v/petermillspaugh/refreshToken";
16
17 app.get("/", async (c) => {
18 return c.html(fetchSignupHtml());
19 });
20
32
33 // Lack of await is intentional: send optimistic success response, then send email and notify myself async
34 sendVerification({ emailAddress: email, html: fetchConfirmationHtml({ email, token }) });
35
36 return Response.json({ success: true, message: "Sent verification email." });
46 sendVerification({
47 emailAddress: email,
48 html: fetchConfirmationHtml({ email, token: newToken, reVerifying: true }),
49 });
50
102 });
103
104 return app.fetch(req);
105}

uploadByURLmain.tsx2 matches

@stevedylandev•Updated 1 year ago
3 export default async function uploadByURL(url){
4 try {
5 const urlStream = await fetch(url)
6 const arrayBuffer = await urlStream.arrayBuffer()
7 const blob = new Blob([arrayBuffer])
9 const data = new FormData()
10 data.append("file", blob)
11 const upload = await fetch('https://api.pinata.cloud/pinning/pinFileToIPFS', {
12 method: 'POST',
13 headers: {

search_heroiconsmain.tsx1 match

@pomdtr•Updated 1 year ago
2
3export default async function(ctx: BrowserContext) {
4 const resp = await fetch("https://api.iconify.design/collection?prefix=heroicons");
5 if (!resp.ok) {
6 throw new Error(await resp.text());

glifJsonmain.tsx2 matches

@cjpais•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const glifJson = async (id: string) => {
14 const url = `https://alpha.glif.xyz/api/glifs?id=${id}`;
15 try {
16 const response = await fetch(url);
17 if (!response.ok) {
18 throw new Error(`HTTP error! status: ${response.status}`);

fetchPaginatedData2 file matches

@nbbaier•Updated 3 weeks ago

FetchBasic1 file match

@fredmoon•Updated 3 weeks ago