1// This tries to fetch a specific post on multiple Lemmpy instances
2// and can try to fix missing comments on a specific instance.
3export async function getLemmyPosts(instance: string, communityName: string) {
4 const { LemmyHttp } = await import("npm:lemmy-js-client");
5 let client = new LemmyHttp(`https://${instance}`, {
6 fetchFunction: fetch,
7 });
8 const { posts } = await client.getPosts({
1export function api500(req: express.Request, res: express.Response) {
2 res.status(503);
3 res.json({
1export function api400(req: express.Request, res: express.Response) {
2 res.status(400);
3 res.json({
1export function myApi(name) {
2 return "hi " + name;
3}
1export function testHTML(req: express.Request, res: express.Response) {
2 res.send(
3 "<html lang='en'>" +
27 };
28
29 function setup() {
30 createCanvas(800, 300);
31 resetGame();
32 }
33
34 function resetGame() {
35 dino = new Dino();
36 obstacles = [];
41 }
42
43 function draw() {
44 if (isGameOver) {
45 showGameOver();
94 }
95
96 function keyPressed() {
97 if (keyCode === 32) {
98 if (isGameOver) {
107 }
108
109 function gameOver() {
110 isGameOver = true;
111 let name = prompt("Enter your name (max 16 characters, no spaces):");
113 scoreboard.push({ name, score });
114
115 // Call the function to update the scoreboard on the Val Town API
116 updateScoreboard(name, score);
117 }
118
119 function updateScoreboard(name, score) {
120 const apiUrl =
121 "https://api.val.town/v1/run/rodrigotello.updateDinoScoreboard";
147 }
148
149 function showGameOver() {
150 background(255);
151 textAlign(CENTER);
176 }
177
178 function showGamePaused() {
179 background(255);
180 textAlign(CENTER);
1import { fetchHtmlDom } from "https://esm.town/v/aeaton/fetchHtmlDom";
2
3export async function peelSessionLetters() {
4 const url = `https://www.bbc.co.uk/radio1/johnpeel/artists/`;
5 const dom = await fetchHtmlDom(url);
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",