78const endpointURL = "https://mjweaver01-sermongptapi.web.val.run";
79
80function App() {
81 const [question, setQuestion] = useState("");
82 const [response, setResponse] = useState("");
617}
618
619function client() {
620 const root = document.getElementById("root");
621 if (!root) throw new Error("Root element not found");
633}
634
635export default async function server(request: Request): Promise<Response> {
636 const { blob } = await import("https://esm.town/v/std/blob");
637
664}
665
666// Helper function to determine season based on current date
667function getSeason(date: Date): string {
668 const month = date.getMonth();
669 switch (true) {
15 "recipe ingredient converter and scaler",
16 "morse code translator with audio output",
17 "random quote generator with tweet functionality",
18 "personal finance tracker with basic charts",
19 "multiplayer rock-paper-scissors game",
20];
21
22function Dashboard() {
23 const [stats, setStats] = useState<{
24 totalGenerations: number;
36
37 useEffect(() => {
38 async function fetchStats() {
39 const response = await fetch("/dashboard-stats");
40 const data = await response.json();
115}
116
117function App() {
118 const [prompt, setPrompt] = useState(
119 STARTER_PROMPTS[Math.floor(Math.random() * STARTER_PROMPTS.length)],
141 });
142
143 async function handleSubmit(e: React.FormEvent) {
144 e.preventDefault();
145 setLoading(true);
174 }
175
176 function handleVersionChange(direction: "back" | "forward") {
177 const { currentVersionIndex, versions } = versionHistory;
178
305}
306
307function client() {
308 const path = window.location.pathname;
309 const root = createRoot(document.getElementById("root")!);
320}
321
322function extractCodeFromFence(text: string): string {
323 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
324 return htmlMatch ? htmlMatch[1].trim() : text;
325}
326
327export default async function server(req: Request): Promise<Response> {
328 // Dynamic import for SQLite to avoid client-side import
329 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
21];
22
23function HomePage() {
24 return (
25 <div className="page">
81}
82
83function ResourcesPage() {
84 return (
85 <div className="page">
133}
134
135function CommunityPage() {
136 return (
137 <div className="page">
194}
195
196function App() {
197 const [currentPage, setCurrentPage] = useState('home');
198
212}
213
214function client() {
215 createRoot(document.getElementById("root")).render(<App />);
216}
217if (typeof document !== "undefined") { client(); }
218
219export default async function server(request: Request): Promise<Response> {
220 return new Response(`
221 <html>
12});
13
14function getStripeCustomer(customerId: string) {
15 return stripe.customers.retrieve(customerId);
16}
1import { Client } from "https://esm.sh/@notionhq/client";
2
3export default async function server(request: Request): Promise<Response> {
4 // Retrieve Notion API token from environment variable
5 const notionToken = Deno.env.get("NOTION_API_TOKEN");
53}
54
55function generateRSSFeed(pages: any[], databaseMetadata: any): string {
56 // Get database title from database metadata
57 const databaseTitle = databaseMetadata.title[0]?.text.content
103}
104
105function escapeXml(unsafe: string): string {
106 return unsafe.replace(/[<>&'"]/g, function(c) {
107 switch (c) {
108 case "<":
14]
15
16function esc(string) {
17 return replacements.reduce(function(string, replacement) {
18 return string.replace(replacement[0], replacement[1])
19 }, string)
71 )
72
73 function c(tag, style) {
74 const elem = document.createElement(tag)
75 if (style) elem.style = style
17const COBALT_API_URL = "https://dorsiblancoapicobalt.nulo.in";
18
19async function fetchMedia(url) {
20 try {
21 const response = await fetch(COBALT_API_URL, {
58}
59
60async function fetchTweets(dumpFile) {
61 try {
62 const response = await fetch(BASE_URL + dumpFile);
96}
97
98function extractMediaUrls(tweet) {
99 const mediaUrls = [];
100 if (tweet.__raw_UNSTABLE && tweet.__raw_UNSTABLE.extended_entities && tweet.__raw_UNSTABLE.extended_entities.media) {
113}
114
115function formatDate(dateString) {
116 const date = new Date(dateString);
117 return date.toLocaleString("es-AR", {
125}
126
127function Tweet({ tweet, onMediaLoad }) {
128 const formattedDate = formatDate(tweet.timeParsed);
129 const [mediaContent, setMediaContent] = useState([]);
131
132 useEffect(() => {
133 async function loadMedia() {
134 const media = await Promise.all(tweet.mediaUrls.map(async (media) => {
135 if (media.type === "video") {
188}
189
190function App() {
191 const [tweets, setTweets] = useState([]);
192 const [filteredTweets, setFilteredTweets] = useState([]);
230 }, [searchQuery, tweets]);
231
232 async function loadTweets() {
233 if (isLoading) return;
234 setIsLoading(true);
364}
365
366function client() {
367 createRoot(document.getElementById("root")).render(<App />);
368}
372}
373
374export default async function server(request: Request): Promise<Response> {
375 return new Response(
376 `
8 .join(" OR ") + " " + excludes;
9
10function relevant(t: Tweet) {
11 if (keywords.some(k => t.full_text?.includes(k))) return true;
12 return t.entities.urls?.some(u => keywords.some(k => u.expanded_url?.includes(k)));
17const isProd = true;
18
19export async function twitterAlert({ lastRunAt }: Interval) {
20 // search
21 const since = isProd
4import React, { useRef, useState, useEffect } from "https://esm.sh/react@18.2.0";
5
6function App() {
7 const [username, setUsername] = useState("");
8 const [valName, setValName] = useState("");
158}
159
160function client() {
161 createRoot(document.getElementById("root")).render(<App />);
162}
163if (typeof document !== "undefined") { client(); }
164
165export default async function server(request: Request): Promise<Response> {
166 const url = new URL(request.url);
167 const parts = url.pathname.split('/').filter(Boolean);
248 });
249 } catch (error) {
250 console.error('Error in server function:', error);
251 return new Response(`Error: ${error.message}`, { status: 500 });
252 }
4import { createRoot } from "https://esm.sh/react-dom/client";
5
6function App() {
7 const [cardData, setCardData] = useState(null);
8
41}
42
43function PersonalCard({ data }) {
44 return (
45 <div className="bg-white rounded-xl shadow-2xl max-w-md w-full overflow-hidden">
115}
116
117function getBackgroundColor(index) {
118 const colors = ["bg-blue-100", "bg-green-100", "bg-purple-100", "bg-orange-100"];
119 return colors[index % colors.length];
120}
121
122function client() {
123 createRoot(document.getElementById("root")).render(<App />);
124}
128}
129
130async function server(request: Request): Promise<Response> {
131 if (request.method === "POST" && new URL(request.url).pathname === "/generate") {
132 const formData = await request.formData();