1import { fetchDateMeProfiles } from "https://esm.town/v/stevekrouse/fetchDateMeProfiles";
2
3// date me docs of women in nyc
4export let dateMeNYWomen = fetchDateMeProfiles().then((
5 profiles,
6) =>
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let spotifyAPI = ({token, endpoint, ...params}) => fetchJSON(
4 `https://api.spotify.com/v1/${endpoint}?${new URLSearchParams(params)}`,
5 {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let runPOST = fetchJSON(
4 `https://api.val.town/v1/run/stevekrouse.add`,
5 {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Returns NASA's Astronomy Picture of the Day (APOD)
4export const nasaAPOD = fetchJSON("cutt.ly/T7ksirK");
5// Forked from @iBrokeit.nasaAPOD
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({