1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const proxyJpeg = async (request: Request): Promise<Response> => {
4 const url = new URL(request.url).searchParams.get("url");
5 const response = await fetch(url);
6 const blob = await response.arrayBuffer();
7 return new Response(blob, {
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let getSeattleSubwayInstagramPosts = async (
4 request: Request,
5): Promise<Response> => {
6 let data = await fetch(
7 `https://api.apify.com/v2/acts/apify~instagram-post-scraper/runs/last/dataset/items?token=apify_api_wi6mnWH8aJ5yiwv3ePmYV7BI31yTE13ameye`,
8 );
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let currency = async (base = "eur", desired, amount = 1) => {
4 let { rates } = await fetchJSON(
5 "https://open.er-api.com/v6/latest/eur"
6 );
8 return amount * rates[desired.toUpperCase()];
9 else {
10 let { rates } = await fetchJSON(
11 "https://api.coingecko.com/api/v3/exchange_rates"
12 );
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3export const webscrapeMinhaBibliotecaCatolicaBoxList = (async () => {
5 "https://assine.bibliotecacatolica.com.br/edicoes-anteriores";
6 const { default: cheerio } = await import("npm:cheerio");
7 const html = await fetchText(sourceUrl);
8 console.log(cheerio);
9 const $ = cheerio.load(html);
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let fetchWithJSON = async <T = any>(url: string, options?: any): Promise<T> => {
4 try {
5 let response = await fetch(url, {
6 ...options,
7 headers: {
12 return await response.json();
13 } catch (error) {
14 throw new Error(`${error.message} in fetch ${url}."`);
15 }
16};
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let aqi = async () => {
4 let pm25 = (
5 await fetchJSON(
6 "https://api.openaq.org/v2/latest?" +
7 new URLSearchParams({
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let stableDiffusionGet = async (key, url) => {
6 "Content-Type": "application/json",
7 };
8 const res = await fetch(url, { headers });
9 return res.json();
10}
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const getFatCatListings = async () => {
4 const meResult = await fetch(
5 "https://api-mainnet.magiceden.dev/v2/collections/degenfatcats/listings?offset=0&limit=20",
6 {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Github following
4export let githubFollowing = fetchJSON(
5 "https://api.github.com/users/stevekrouse/following"
6);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Github following
4export let githubFollowing = fetchJSON(
5 "https://api.github.com/users/stevekrouse/following"
6);