1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function parseHtml(url: string) {
5 "https://deno.land/x/deno_dom/deno-dom-wasm.ts"
6 );
7 const response = await fetch(url);
8 const text = await response.text();
9 const parsed = new DOMParser().parseFromString(text, "text/html");
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let // View this in a web browser!
5// https://api3.val.town/express/async%20(req,%20res)%20=%3Eres.send(@healeycodes.hnTopStories)
6const hnTopStories = (async () => {
7 let valTownFetchLimit = 100;
8 const topStories: Number[] = await fetch(
9 "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
10 ).then((res) => res.json());
11 valTownFetchLimit--;
12 const topStoriesData: Promise<{
13 title: string;
14 url: string;
15 }>[] = topStories.slice(0, valTownFetchLimit).map(async (id) => {
16 return await fetch(
17 `https://hacker-news.firebaseio.com/v0/item/${id}.json?print=pretty`
18 ).then((res) => res.json());
1import { fetchJSON } from "https://esm.town/v/axelav/fetchJSON";
2import process from "node:process";
3
85 results: DiscogsRelease[];
86 }> =>
87 fetchJSON(
88 `https://api.discogs.com/database/search?token=${token}&q=${query}${
89 isMaster ? "&type=master" : ""
91 );
92 const getMasterRelease = async (id: string): Promise<DiscogsRelease> =>
93 fetchJSON(
94 `https://api.discogs.com/masters/${id}?token=${token}`
95 );
96 const getMainRelease = async (id: string): Promise<DiscogsRelease> =>
97 fetchJSON(
98 `https://api.discogs.com/releases/${id}?token=${token}`
99 );
1import { fetch } from "https://esm.town/v/std/fetch";
2
3let { interactiveBrokersMarginsState } = await import("https://esm.town/v/simone/interactiveBrokersMarginsState");
13 async function loadInteractiveBrokersData() {
14 const cheerio = await import("npm:cheerio");
15 const response = await fetch(
16 "https://www.interactivebrokers.com/en/trading/margin-futures-fops.php"
17 );
1import { fetch } from "https://esm.town/v/std/fetch";
2import { example1 } from "https://esm.town/v/stevekrouse/example1?v=3";
3import process from "node:process";
41 type: 4,
42 data: {
43 content: `${await (await fetch(
44 "https://api.val.town/v1/eval/" +
45 encodeURIComponent(body.data.options[0].value),
1import process from "node:process";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export const airtable_get_sample = (async () => {
5 const data = await fetchJSON(
6 "https://api.airtable.com/v0/appXSrKDlwbAijRmD/All%20content/recxS2AKaE1klriwW",
7 {
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let gql = (api, query, variables = {}) =>
4 fetch(api, {
5 method: "POST",
6 body: JSON.stringify({ query, variables }),
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function githubStars(
6 bearer?: string,
7) {
8 const { stargazers_count } = await fetchJSON(
9 `https://api.github.com/repos/${encodeURIComponent(handle)}/${
10 encodeURIComponent(repo)
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function getFirebaseTweets() {
4 const result = await fetch("https://twitter.com/firebase");
5 console.log(result);
6}
7 const { LemmyHttp } = await import("npm:lemmy-js-client@0.18.1");
8 let client = new LemmyHttp(`https://${instance}`, {
9 fetchFunction: fetch,
10 });
11 try {