4const location = "koetsierbaan 87, almere, netherlands"; // <-- change to place, city, or zip code
5
6export async function aqi(interval: Interval) {
7 const data = await easyAQI({ location });
8 if (!interval.lastRunAt) {
48const cacheKey = (location: string) => "easyAQI_v3_" + encodeURIComponent(location);
49
50export async function openAqNowcastAQI(location) {
51 const sensorID = location.sensors.find(s => s.parameter.name === "pm25").id;
52 const data = await fetchJSON(
64}
65
66export async function easyAQI({ location }: {
67 location: string;
68}) {
1const TARGET_URL = "https://api.openaq.org";
2
3export default async function(req: Request): Promise<Response> {
4 const url = new URL(req.url);
5 return fetch(TARGET_URL + url.pathname + url.search, {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function nominatimSearch(params: Search): Promise<Place[]> {
4 return fetchJSON(
5 "https://nominatim.openstreetmap.org/search?"
1import { blob } from "https://esm.town/v/std/blob";
2
3export default async function(req: Request): Promise<Response> {
4 const path = new URL(req.url).pathname;
5
23`;
24
25function Hero() {
26 return (
27 <div className="hero">
32}
33
34function HowItWorks() {
35 return (
36 <div className="how-it-works">
53}
54
55function App() {
56 const [ycCompanies, setYcCompanies] = useState<YCCompany[]>([]);
57 const [mergedData, setMergedData] = useState<any[]>([]);
217}
218
219function client() {
220 createRoot(document.getElementById("root")!).render(<App />);
221}
225}
226
227export default async function server(request: Request): Promise<Response> {
228 const companies = await fetch("https://stevekrouse-yc_database.web.val.run").then(res => res.json());
229 const url = new URL(request.url);
1export default async function (req: Request): Promise<Response> {
2 console.log("test");
3 return new Response(
30 * Store a chat message in the database
31 */
32export async function storeChatMessage(
33 chatId,
34 senderId,
63 * Retrieve chat history for a specific chat
64 */
65export async function getChatHistory(chatId, limit = 50) {
66 try {
67 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
88 * Format chat history for Anthropic API
89 */
90function formatChatHistoryForAI(history) {
91 const messages = [];
92
112 * Analyze a Telegram message and extract memories from it
113 */
114async function analyzeMessageContent(
115 anthropic,
116 username,
487
488// Handle webhook requests
489export default async function(req: Request): Promise<Response> {
490 // Set webhook if it is not set yet
491 if (!isEndpointSet) {
10await initializeAggregatorDB();
11
12export default async function(req: Request): Promise<Response> {
13 const url = new URL(req.url);
14 const path = url.pathname.toLowerCase();
1// frontend.js
2
3export function serveFrontend(req: Request): Response {
4 const feedUrl = `https://${Deno.env.get("USER")}-${Deno.env.get("NAME")}.web.val.run/feed.xml`;
5
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": "*",