1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchWikipediaContent(url) {
4 try {
5 const title = url.split("/wiki/")[1];
6 const apiUrl = `https://en.wikipedia.org/w/api.php?action=query&prop=extracts&exintro&explaintext&format=json&origin=*&titles=${title}`;
7 const response = await fetch(apiUrl);
8 const data = await response.json();
9 const pageId = Object.keys(data.query.pages)[0];
11 return content;
12 } catch (error) {
13 console.error(`Error fetching Wikipedia content: ${error.message}`);
14 return "";
15 }
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function sendMessage(ptnKey: string, message: string) {
4 await fetch("https://app.phonetonote.com/hooks/zapier", {
5 body: JSON.stringify({
6 ptn_key: ptnKey,
1import { fetch } from "https://esm.town/v/std/fetch";
2import { extractReiseauskunftDbStationCodeFromUrl } from "https://esm.town/v/hanbzu/extractReiseauskunftDbStationCodeFromUrl";
3
24 return matches;
25 }
26 return fetch(
27 `https://reiseauskunft.bahn.de/bin/bhftafel.exe/dn?${new URLSearchParams({
28 input: station,
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Cities named Brooklyn
4export let cityLookup = fetchJSON(
5 "https://nominatim.openstreetmap.org/search.php?city=brooklyn&format=jsonv2"
6);
1import { fetch } from "https://esm.town/v/std/fetch";
2import { parseBlock } from "https://esm.town/v/usefulthink/parseBlock";
3
14 "phery[remote]": "get_kurse",
15 };
16 const res = await fetch(
17 "https://www.baederland-shop.de/schwimmschule?_=" + Date.now(),
18 {
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";
2import process from "node:process";
3
4export async function githubNotifications() {
5 const res = await fetch("https://api.github.com/notifications?all=true", {
6 headers: {
7 Authorization: `Bearer ${process.env.GH_TOKEN}`,
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const nearestOpenStation = async ({ lon, lat }) => {
13 const {
14 data: { stations: stationInfo },
15 } = await fetch(
16 `https://gbfs.${gbfsDomain}/gbfs/en/station_status.json`
17 ).then((r) => r.json());
23 const {
24 data: { stations },
25 } = await fetch(
26 `https://gbfs.${gbfsDomain}/gbfs/en/station_information.json`
27 ).then((r) => r.json());
1import { fetchJSON } from "https://esm.town/v/sean/fetchJSON";
2import { toQueryString } from "https://esm.town/v/sean/toQueryString";
3
16
17 try {
18 const json = await fetchJSON(
19 `https://${API_HOST}/query?${queryString}`,
20 {
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let getEpicTvProduct = async (url) => {
4 const cheerio = await import("npm:cheerio@1.0.0-rc.12");
5 const html = await (await fetch(url)).text();
6 const $ = cheerio.load(html);
7 return {