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};
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})();
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 );
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 {
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({
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: {
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
1export let YoutubeTranscript = async (videoId) => {
2 const { YoutubeTranscript } = await import("npm:youtube-transcript");
3 return YoutubeTranscript.fetchTranscript(videoId);
4};
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const fetchFile = async (url: string, options?: any) => {
4 const fileUrl =
5 "https://www.gcmgrosvenor.com/wp-content/uploads/Private-Credit-Co-investing-GCM-Grosvenor.pdf";
6 const blob = await fetch(fileUrl).then((r) => r.blob());
7 return blob;
8};
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export async function EmailNotifIfDidntCode() {
14 org?: any;
15 }
16 const githubEvents = await fetchJSON(
17 "https://api.github.com/users/daviddkkim/events",
18 ) as Data;