1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function fetchValTownAPI(
4 apiToken: string,
5 path: string,
6 options?: RequestInit,
12 path = "/v1" + path;
13 }
14 return fetchJSON(`https://api.val.town${path}`, {
15 ...options,
16 headers: {
17 "Authorization": `Bearer ${apiToken}`,
18 ...(options?.headers || {}),
19 },
1// Get news from different sources I care about
2export let untitled2342187 = interface LeNews {
3 feedlyAPI: {
4 name: String,
5 desc: String,
8}
9
10export async function giveMeLeNews({ feedlyAPI }: LeNews) {
11 return "Works";
12}
3
4export const elevenlabsTTS = async (req, res) => {
5 // https://platform.openai.com/docs/api-reference/images/create
6 // https://ale_annini-elevenlabstts.express.val.run/?args=[%22{\%22text\%22:\%22it%20beautiful\%22}%22]
7 const payload = {
13 },
14 };
15 const voiceId = "21m00Tcm4TlvDq8ikWAM"; // https://api.elevenlabs.io/v1/voices
16 const audio = await fetch(
17 `https://api.elevenlabs.io/v1/text-to-speech/${voiceId}`,
18 {
19 method: "POST",
20 headers: {
21 "Accept": "audio/mpeg",
22 "xi-api-key": process.env.ELEVENLABS_API_KEY,
23 "Content-Type": "application/json",
24 },
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
23 async function fetchCount(id) {
24 const endpoint =
25 `https://functions.api.ticos-systems.cloud/api/gates/counter?organizationUnitIds=${id}`;
26 const response = await fetch(endpoint, {
27 headers: {
1import { fetch } from "https://esm.town/v/std/fetch";
2import { API_BASE_URL } from "https://esm.town/v/mangadex/API_BASE_URL";
3
4type LoginSuccess = {
28): Promise<LoginResponse> => {
29 const response = await fetch(
30 `${API_BASE_URL}/auth/login`,
31 {
32 method: "POST",
1import { fetch } from "https://esm.town/v/std/fetch";
2import { API_BASE_URL } from "https://esm.town/v/mangadex/API_BASE_URL";
3
4type LoginSuccess = {
27 }
28 const response = await fetch(
29 `${API_BASE_URL}/list/${listId}/feed`,
30 {
31 headers: {
3export async function updateTicketCoordinator() {
4 // read user profiles and fint those who want to be a tickets master and add those to group @tickets-coordinators
5 // Require the Node Slack SDK package (github.com/slackapi/node-slack-sdk)
6 const { WebClient, LogLevel } = import("npm:@slack/web-api");
7 // read all
8 const slackAccessToken = process.env.slackAccessToken;
24 );
25 try {
26 // InitializeSlack API client
27 const client = new WebClient(slackAccessToken, { logLevel: LogLevel.WARN });
28 // Fetch all users
1export function myApi(name) {
2 return "hi " + name;
3}