1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function getInvitesFromReddit() {
4 const codeRegex = /bsky-social-[a-zA-Z0-9]+/g;
5 const result = await fetchJSON(
14 const importObj = {};
15 const { instance } = await WebAssembly.instantiate(source.buffer, importObj);
16 const addTwo = instance.exports.addTwo as CallableFunction;
17 return addTwo(2, 3);
18};
1export function myApi(url) {
2 return "https://tldrify.com/ajaxproxy?url=" + url;
3}
1export async function helloMessage(MESSAGE) {
2 console.log(`Message: ${MESSAGE}`);
3}
1import { delay } from "https://esm.town/v/andreterron/delay";
2
3export async function asyncThrow() {
4 await delay(100);
5 throw new Error("Error thrown on async function");
6}
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function searchTweets({ accessToken, query, params }: {
4 accessToken: string;
5 query: string;
1export function myApi(name) {
2 return "hi " + name;
3}
1export function analysisTransaction(req: express.Request, res: express.Response) {
2 console.log(req.body);
3 res.end("Handle Webhook Success");
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export function postToMastodon(mastodonApiUrl, mastodonAccessToken, status) {
4 return fetch(
5 `${mastodonApiUrl}/statuses?access_token=${mastodonAccessToken}`,
2
3// Fetches air quality sensor data from Kaiterra in prometheus line format
4export async function kaiterra_prometheus(
5 req: express.Request,
6 res: express.Response,
13 let prometheus_data = kiosk_data.indoor.flatMap((indoor_data) =>
14 indoor_data.data.flatMap((data) =>
15 data.points.flatMap(function (point) {
16 let timestamp = new Date(point.ts).getTime();
17 let param_name = data.param.replace("-", "_");
A helper function to build a file's email
Simple functional CSS library for Val Town
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.