1import { fetch } from "https://esm.town/v/std/fetch";
2import { API_BASE_URL } from "https://esm.town/v/mangadex/API_BASE_URL";
3
27 password: string,
28): Promise<LoginResponse> => {
29 const response = await fetch(
30 `${API_BASE_URL}/auth/login`,
31 {
1import { fetch } from "https://esm.town/v/std/fetch";
2import { API_BASE_URL } from "https://esm.town/v/mangadex/API_BASE_URL";
3
26 return "The provided login credentials are incorrect.";
27 }
28 const response = await fetch(
29 `${API_BASE_URL}/list/${listId}/feed`,
30 {
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const callIftttMakerWebhook = async (event: string, key: string) => {
4 await fetch(`https://maker.ifttt.com/trigger/${event}/json/with/key/${key}`);
5};
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const sendNtfy = async (topic: string, data: {
7 isMarkdown: boolean;
8}) => {
9 const response = await fetch(`https://ntfy.sh/${topic}`, {
10 method: "POST",
11 body: data.body,
26 // InitializeSlack API client
27 const client = new WebClient(slackAccessToken, { logLevel: LogLevel.WARN });
28 // Fetch all users
29 const result = await client.users.list({ team_id: teamId });
30 let users = result.members;
35 );
36 console.log(`Found ${users.length} users in team ${teamId}`);
37 // Fetch extended user profiles with custom fields and filter only coordinators
38 const profiles = await Promise.all(users.map(async (user) => {
39 const result = await client.users.profile.get({ user: user.id });
45 };
46 }));
47 console.log(`Fetched ${profiles.length} profiles in team ${teamId}`);
48 const ticketsCoordinators = profiles.filter((profile) =>
49 profile.ticketsCoordinator
1import { paginateAPI } from "https://esm.town/v/andreterron/paginateAPI";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3import process from "node:process";
4
12 },
13 };
14 const me = await fetchJSON(
15 "https://api.val.town/v1/me",
16 opts,
1import { fetch } from "https://esm.town/v/std/fetch";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export const citiBikeSpotChecker = async (req, res) => {
5 const { data } = await fetch(
6 "https://gbfs.citibikenyc.com/gbfs/en/station_status.json"
7 ).then((r) => r.json());
17 const {
18 data: { stations: stationInfo },
19 } = await fetchJSON(
20 "https://gbfs.citibikenyc.com/gbfs/en/station_information.json"
21 );
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub repos
4export let githubRepos = fetchJSON(
5 "https://api.github.com/users/stevekrouse/repos"
6);
1import { fetchCat } from "https://esm.town/v/cole/fetchCat";
2
3export let dailyCat = async () => {
4 const url = fetchCat();
5 const html = `Here's a random cat: <img src="${url}">`;
6 console.email({ html }, "random cat");
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let blocks = async (req, res) => {
23 }
24 }"
25 x-init="blocks = await (await fetch('https://storage.googleapis.com/bb-search-data/parsed/blocks-min.json')).json()"
26 >
27 <div class='grid gap-4 grid-cols-4 lg:grid-cols-8'>
51 </html>`);
52 }
53 const gistRes = await fetch(`https://api.github.com/gists/${id}`);
54 if (!gistRes.ok) {
55 return res.send("GitHub replied with a non-200 status.");