11];
12
13export async function pollRSSFeeds({ lastRunAt }: Interval) {
14 const password = Deno.env.get(bskyPassword);
15
5};
6
7export default async function(req: Request): Promise<Response> {
8 const url = "https://public.api.bsky.app/xrpc/app.bsky.feed.getAuthorFeed?actor=dai.bsky.social&filter=posts_no_replies";
9
1import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
2
3export async function reportErrorAndExit(source: string, message: string) {
4 let content = "# Error from " + source;
5 const append = (text: string) => {
1import { email } from "https://esm.town/v/std/email?v=9";
2async function fetchRandomJoke() {
3 const response = await fetch(
4 "https://official-joke-api.appspot.com/random_joke",
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = fetch(
6 "https://official-joke-api.appspot.com/random_joke",
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
1import { email } from "https://esm.town/v/std/email?v=9";
2
3async function fetchRandomJoke() {
4 const response = await fetch(
5 "https://official-joke-api.appspot.com/random_joke",
2
3// Fetches a random joke.
4function fetchRandomJoke() {
5 async function fetchRandomJoke() {
6 const response = await fetch(
7 "https://official-joke-api.appspot.com/random_joke",
2import { JSDOM } from "npm:jsdom";
3
4export default async function(req: Request) {
5 let resp = await fetch(`https://${new URL(req.url).pathname.replace(/^https?:\/\//, '')}`, req);
6 let body = await resp.text();
5
6// Existing uptime check logic
7async function uptimeCheck(url: string) {
8 let reason: string, status: number, end: number;
9 let ok = true;
40
41// Run uptime checks on startup
42async function runUptimeChecks() {
43 ["https://students.kpfu.ru", "https://media.kpfu.ru"].forEach(uptimeCheck);
44}
46
47// React Frontend Component
48function UptimeDashboard() {
49 const [uptimeData, setUptimeData] = useState([]);
50 const [loading, setLoading] = useState(true);
51
52 useEffect(() => {
53 async function fetchUptimeData() {
54 try {
55 const response = await fetch('/uptime-data');
111
112// Client-side rendering
113function client() {
114 createRoot(document.getElementById("root")).render(<UptimeDashboard />);
115}
117
118// Server-side handler
119export default async function server(request: Request): Promise<Response> {
120 const url = new URL(request.url);
121
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": "*",