3import { fetchRss } from "https://esm.town/v/pdebie/fetchRss";
4
5export async function syncCommentToLemmy(
6 instance: string,
7 redditUrl: string,
10 matcher?: (author: string, content: string) => boolean,
11) {
12 function hashCode(str) {
13 let hash = 0;
14 for (let i = 0, len = str.length; i < len; i++) {
21 const { LemmyHttp } = await import("npm:lemmy-js-client@0.18.1");
22 let client = new LemmyHttp(`https://${instance}`, {
23 fetchFunction: fetch,
24 });
25 // (client as any)["#fetchFunction"] = fetch;
26 let comments = (await fetchRss(redditUrl)).filter((i) =>
27 new Date(i.isoDate) >= new Date(Date.now() - 1000 * 60 * 60 * 24)
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchHtmlDom(url: string) {
4 const { DOMParser } = await import(
5 "https://deno.land/x/deno_dom/deno-dom-wasm.ts"
1export function myApi(name) {
2 return "hi " + name;
3}
2import { ghContent } from "https://esm.town/v/octref/ghContent";
3
4export async function updateISBNFile(isbn: string) {
5 const ISBN_PATH = "data/mine/books-isbn.json";
6 const content = await ghContent(ISBN_PATH);
1export function myApi(name) {
2 return "hi " + name;
3}
4 lon = +lon;
5 lat = +lat;
6 function dist(station) {
7 return Math.sqrt(
8 Math.pow(station.lat - lat, 2) + Math.pow(station.lon - lon, 2),
1// assumes React is in scope, and returns a valid HTML script string for rendering a React Component
2export function myReactComponent() {
3 return `
4const Example = () => {
1export function arraysAreIdentical(arr1, arr2) {
2 if (arr1.length !== arr2.length) {
3 return false;
Simple functional CSS library for Val Town
A helper function to build a file's email
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.