1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let sendNotification = async (params: { channel: string, message: string }) => {
9
10 try {
11 const response = await fetch(`https://ntfy.sh/${channel}`, {
12 method: "POST",
13 body: message,
3import { dateCalendarKey } from "https://esm.town/v/tal/dateCalendarKey";
4import { parseMenuLine } from "https://esm.town/v/tal/parseMenuLine";
5import { fetchDOEMenu } from "https://esm.town/v/tal/fetchDOEMenu";
6
7export async function fetchAndStore(opts: {
8 schoolYear: `${number}-${number}`;
9 month: string;
10 menuType: string;
11}) {
12 const menuText = await fetchDOEMenu(opts);
13 const lines: ReturnType<typeof parseMenuLine>[] = await Promise
14 .all(menuText.split("\r\n").map(parseMenuLine));
15 const key = dateCalendarKey(opts);
16 doeMenuResponseStore[key] = {
17 lastFetchedAt: new Date(),
18 lines,
19 };
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function communityBoatingFlag() {
4 const response = await fetch("https://api.community-boating.org/api/flag");
5 const text = await response.text();
6 // Regex by Chat GPT :shrug:
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function emailDailyJoke() {
4 async function fetchJoke() {
5 let response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
10 }
11 }
12 const randomJoke = await fetchJoke();
13 const setup = randomJoke.setup;
14 const punchline = randomJoke.punchline;
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let openAiTextCompletion = async (params: {
33 args.stream = false;
34
35 const response = await fetchJSON("https://api.openai.com/v1/completions", {
36 method: "POST",
37 headers: {
1import { fetch } from "https://esm.town/v/std/fetch";
2
3let { tradestationMarginsState } = await import("https://esm.town/v/simone/tradestationMarginsState");
13 async function loadTradestationData() {
14 const cheerio = await import("npm:cheerio");
15 const response = await fetch(
16 "https://www.tradestation.com/pricing/futures-margin-requirements/"
17 );
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function time() {
4 return await fetchJSON(
5 "https://api.openaq.org/v2/latest?" +
6 new URLSearchParams({
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub followers
4export let githubFollowers = fetchJSON(
5 "https://api.github.com/users/stevekrouse/followers"
6);
1import { fetch } from "https://esm.town/v/std/fetch";
2import { email } from "https://esm.town/v/std/email?v=9";
3
4export async function getTangleComments({ lastRunAt }) {
5 let response = await fetch(
6 "https://www.readtangle.com/members/api/comments/?limit=5&order=created_at%20DESC%2C%20id%20DESC&filter=post_id%3A6525827c68f969000134e052%2Bcreated_at%3A%3C%3D2023-10-13T20%3A55%3A23.163Z&page=2",
7 );
8 let commentsData = await response.json();
9 console.log("Fetched Data:", commentsData);
10 console.log(commentsData);
11 const newComments = commentsData.comments.filter((comment) =>
1import { fetchRSS } from "https://esm.town/v/stevekrouse/fetchRSS?v=12";
2
3export let webhook1 = async (a) => {
4 const response = await fetchRSS(a);
5 return "asd";
6};