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 { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3export const webscrapeWikipediaIntro = (async () => {
4 const cheerio = await import("npm:cheerio");
5 const html = await fetchText(
6 "https://en.wikipedia.org/wiki/OpenAI",
7 );
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const telegramGetMe = async (botToken: string) =>
4 fetchJSON(
5 `https://api.telegram.org/bot${botToken}/getMe`,
6 );
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub gists
4export let githubGists = fetchJSON(
5 "https://api.github.com/users/stevekrouse/gists"
6);
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let fetchBinance = (payType: string) =>
4 fetch("https://p2p.binance.com/bapi/c2c/v2/friendly/c2c/adv/search", {
5 method: "POST",
6 body: JSON.stringify({
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 valRuns({ token, id, error, source, since, until, offset, limit }: {
37 };
38}> {
39 return fetchJSON(
40 `https://api.val.town/v1/vals/${id}/runs?` +
41 searchParams({
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
3import { secretToTelegramChat } from "https://esm.town/v/pomdtr/secretToTelegramChat";
5export async function sendToTelegram(secret: string, message: string) {
6 const chatID = secretToTelegramChat[secret];
7 const resp = await fetch(
8 `https://api.telegram.org/bot${process.env.telegramToken}/sendMessage?chat_id=${chatID}&text=${message}`,
9 {
1import { fetch } from "https://esm.town/v/std/fetch";
2import { secretSlackWebhookEndpoint } from "https://esm.town/v/eric/secretSlackWebhookEndpoint";
3
5 const slack = secretSlackWebhookEndpoint
6 console.log("@eric.webhook", req.body)
7 await fetch(slack, {
8 method: 'POST',
9 header: {'Content-Type': 'application/json'},
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const markdownToHtml = async (res, req) => {
5 const unified = (await import("npm:unified")).unified;
6 const markdown = (await import("npm:remark-parse")).default;
7 const markdownToConvert = fetch(
8 "https://jessmartin-todoMarkdown.express.val.run",
9 );
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let register_discord_commands = async (
13 url += `commands`;
14 }
15 const response = await fetch(url, {
16 headers: {
17 "Content-Type": "application/json",