5import { falProxyRequest } from "https://esm.town/v/stevekrouse/falProxyRequest";
6
7function App() {
8 const [prompt, setPrompt] = useState("");
9 const [imageUrl, setImageUrl] = useState("");
103}
104
105function client() {
106 createRoot(document.getElementById("root")).render(<App />);
107}
108if (typeof document !== "undefined") { client(); }
109
110export default async function server(req: Request): Promise<Response> {
111 const url = new URL(req.url);
112 if (url.pathname === "/") {
160 });
161
162export default async function (req: Request): Promise<Response> {
163 const url = new URL(req.url);
164 if (url.pathname === "/") {
8};
9
10async function handleRequest(request) {
11 const url = new URL(request.url);
12
4const ratelimit = new RateLimit({ maximum: 2, interval: "30s" });
5
6export default async function(req: Request): Promise<Response> {
7 /*const limit = await ratelimit.check("val.town");
8 if (!limit.ok) {
1export default async function sendxmpp(target: string, body: string) {
2 await fetch("https://singpolyma-sendxmppapi.web.val.run", {
3 method: "POST",
1import Parser from "https://esm.sh/rss-parser@3.13.0";
2
3export default async function(req: Request): Promise<Response> {
4 const url = new URL(req.url);
5 const feedUrl = url.searchParams.get("url");
1export default async function server(request: Request): Promise<Response> {
2 const url = new URL(request.url);
3 const min = parseInt(url.searchParams.get("min") || "2");
15 year: number;
16}
17async function movieHandler(meta: Meta) {
18 const data = await scrapeMovie(meta.imdb_id);
19 let htmlData = "";
37 `;
38}
39async function showHandler(meta: Meta, s, e) {
40 const data = await scrapeShow(meta.imdb_id, s, e);
41 let htmlData = "";
59 `;
60}
61async function getMeta(imdbId: string): Promise<Meta> {
62 const searchResult = await fetch(`${primewireBase}/api/v1/show?key=${primewireApiKey}&imdb_id=${imdbId}`);
63 return await searchResult.json() as Meta;
64}
65
66export async function handler(imdbId: string, season: number, episode: number) {
67 const meta: Meta = await getMeta(imdbId) as Meta;
68 switch (meta.type) {
6import { vscDarkPlus } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [input, setInput] = useState("");
10 const [response, setResponse] = useState("");
101}
102
103function client() {
104 createRoot(document.getElementById("root")).render(<App />);
105}
109}
110
111export default async function server(request: Request): Promise<Response> {
112 const { OpenAI } = await import("https://esm.town/v/std/openai");
113 const openai = new OpenAI();
3let xmpp: Client | null = null;
4
5export default async function sendxmpp(target: string, body: string, keepalive = false) {
6 if (!xmpp) {
7 return new Promise((resolve, reject) => {
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.