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=1243&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 13430 results for "fetch"(2424ms)

publishYoutubeToLemmymain.tsx1 match

@pdebie•Updated 1 year ago
14 const { LemmyHttp } = await import("npm:lemmy-js-client@0.18.1");
15 let client = new LemmyHttp(`https://${instance}`, {
16 fetchFunction: fetch,
17 });
18 const items =

youtubeFeedmain.tsx2 matches

@pdebie•Updated 1 year ago
1import { fetchRss } from "https://esm.town/v/pdebie/fetchRss";
2
3export function youtubeFeed(channelId: string, lastCheckDate?: string | number) {
4 return fetchRss(
5 "https://www.youtube.com/feeds/videos.xml?channel_id=" + channelId,
6 lastCheckDate,

proxyFetch2main.tsx5 matches

@alp•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const proxyFetch2 = async (req, res) => {
4 const { url, options } = req.body;
5 try {
6 const response = await fetch(url, options);
7 return res.status(response.status).send(await response.text());
8 } catch (e) {
9 const errorMessage = e instanceof Error ? e.message : "Unknown error";
10 console.error("Failed to initiate fetch", e);
11 return res.status(500).send(`Failed to initiate fetch: ${errorMessage}`);
12 }
13};

getJSONmain.tsx2 matches

@yuler•Updated 1 year ago
1import { fetchWithJSON } from "https://esm.town/v/yuler/fetchWithJSON";
2
3export let getJSON = <T = any>(url: string): Promise<T> => {
4 console.log(url);
5 return fetchWithJSON(url);
6};

FigmaAvatarsMixerTestmain.tsx2 matches

@rodrigotello•Updated 1 year ago
1import { fetchFigmaFile } from "https://esm.town/v/rodrigotello/fetchFigmaFile";
2import { parseFigmaURL } from "https://esm.town/v/rodrigotello/parseFigmaURL";
3import process from "node:process";
9 "https://www.figma.com/file/XqiternEMTE2Gk8jHzG4Ui/AvatarMixerFileTest?type=design&node-id=0%3A1&mode=design&t=Mpjs48FGMgw77SXW-1",
10 ).key;
11 return fetchFigmaFile(apiToken, fileKey);
12})();

hnTopStorymain.tsx3 matches

@fab1an•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function hnTopStory() {
4 const topStories: Number[] = await fetch(
5 "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
6 ).then((res) => res.json());
13 score: number;
14 by: string;
15 } = await fetch(`https://hacker-news.firebaseio.com/v0/item/${id}.json`).then(
16 (res) => res.json()
17 );

slackReplyToMessagemain.tsx2 matches

@vtdocs•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2import process from "node:process";
3
18 // Note: `req.body.event` has information about the event
19 // like the sender and the message text
20 const result = await fetchJSON(
21 "https://slack.com/api/chat.postMessage",
22 {

valVersionsmain.tsx2 matches

@neverstew•Updated 1 year ago
1import { searchParams } from "https://esm.town/v/stevekrouse/searchParams?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export function valVersions({ token, id, offset, limit }: {
25 }
26 : {};
27 return fetchJSON(
28 `https://api.val.town/v1/vals/${id}/versions?` +
29 searchParams({

renderGithubReadmemain.tsx3 matches

@pomdtr•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function renderGithubReadme(req: express.Request, res: express.Response) {
6 repo: string;
7 };
8 const markdown = await fetch(`https://api.github.com/repos/${repo}/readme`)
9 .then((res) => res.json()).then(({ content }) => atob(content));
10 const html = await fetch("https://api.github.com/markdown", {
11 method: "POST",
12 headers: {

viewMailboxmain.tsx1 match

@nimalu•Updated 1 year ago
24 li.innerHTML = '<span class="font-semibold text-gray-900">Web</span>: ' + message;
25 ul.appendChild(li)
26 fetch("https://api.val.town/eval/@nimalu.messageMe('" + message + "','Web')")
27 }
28

GithubPRFetcher

@andybak•Updated 2 days ago

proxiedfetch1 file match

@jayden•Updated 3 days ago