OpenTownieApiKeyWarning.tsx4 matches
2import React from "https://esm.sh/react@18.2.0?dev";
34interface ApiKeyWarningProps {
5show: boolean;
6}
78export function ApiKeyWarning({ show }: ApiKeyWarningProps) {
9if (!show) return null;
10
11return (
12<div className="bg-yellow-100 border-l-4 border-yellow-500 text-yellow-700 p-4 mb-4 rounded">
13<p className="font-bold">Anthropic API Key Missing</p>
14<p>Please log out and add your Anthropic API key to use this app.</p>
15</div>
16);
ingeniousYellowRavenmain.tsx4 matches
587};
588589// --- API Route: /grade-card ---
590if (request.method === "POST" && new URL(request.url).pathname === "/grade-card") {
591try {
592// Check for OpenAI API Key in Val Town secrets
593const openai = new OpenAI(); // Assumes OPENAI_API_KEY is set in Val Town secrets
594const { imageBase64 } = await request.json();
595if (!imageBase64 || typeof imageBase64 !== "string") {
790<meta name="viewport" content="width=device-width, initial-scale=1.0">
791<meta charset="UTF-8">
792<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
793<style>
794/* --- START Base & Card Grader CSS --- */
campycardsmain.tsx4 matches
587};
588589// --- API Route: /grade-card ---
590if (request.method === "POST" && new URL(request.url).pathname === "/grade-card") {
591try {
592// Check for OpenAI API Key in Val Town secrets
593const openai = new OpenAI(); // Assumes OPENAI_API_KEY is set in Val Town secrets
594const { imageBase64 } = await request.json();
595if (!imageBase64 || typeof imageBase64 !== "string") {
805<meta name="viewport" content="width=device-width, initial-scale=1.0">
806<meta charset="UTF-8">
807<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
808<style>
809/* --- START Base & Card Grader CSS --- */
LoopsNewsletterFormindex.html2 matches
1<style>
2@import url('https://fonts.googleapis.com/css2?family=Inter&display=swap');
3</style><div class="newsletter-form-container">
4<form
5class="newsletter-form"
6action="https://app.loops.so/api/newsletter-form/clic9j2ah00a6kz0fwvrdv41o"
7method="POST"
8style="display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%;"
domainSantamain.tsx1 match
256257<link rel="icon" href="https://karkowg-fav.web.val.run?emoji=🎅" />
258<link href="https://fonts.googleapis.com/css2?family=Mountains+of+Christmas:wght@400;700&display=swap" rel="stylesheet">
259<script src="https://cdn.tailwindcss.com"></script>
260<script>
steel_puppeteer_startermain.tsx4 matches
6});
78const STEEL_API_KEY = process.env.STEEL_API_KEY;
9// Initialize Steel client with the API key from environment variables
10const client = new Steel({
11steelAPIKey: STEEL_API_KEY,
12});
1336// Connect Puppeteer to the Steel session
37browser = await puppeteer.connect({
38browserWSEndpoint: `wss://connect.steel.dev?apiKey=${STEEL_API_KEY}&sessionId=${session.id}`,
39});
40
436}
437438// --- Mock API Response ---
439// In a real app, this section would involve a fetch call.
440// The mock data structure should align with what renderReport expects.
495cardName: imageFile?.name.split(".")[0] || "Uploaded Card", // For easier identification in history
496};
497// --- End Mock API Response ---
498499// Simulate API call delay
500await new Promise(resolve => setTimeout(resolve, 2000 + Math.random() * 1000)); // 2-3 seconds delay
501502// Check for simulated API error randomly
503// if (Math.random() < 0.15) { // 15% chance of error
504// throw new Error("Simulated API Error: Could not process the image.");
505// }
506507/*
508// --- Real API Call Example ---
509const response = await fetch("/api/grade-card", { // Your API endpoint
510method: "POST",
511headers: { "Content-Type": "application/json" },
514515if (!response.ok) {
516let errorMsg = `API Error: ${response.status} ${response.statusText}`;
517try {
518const errData = await response.json();
519errorMsg = errData.error || errorMsg; // Use specific error from API if available
520} catch {
521// Response wasn't JSON, use the status text
530// Assuming 'data' is the grading report object
531const reportData = { ...data, timestamp: generateTimestamp(), imagePreview: imageBase64 };
532// --- End Real API Call ---
533*/
534535// If successful (using mock data here):
536setPendingReportData(mockGradingReport); // Use mockGradingReport or reportData from API
537setIsLoading(false);
538setIsRevealingGrade(true);
versatileWhiteLizardmain.tsx1 match
146results["trends"] = info;
147} catch (error) {
148console.error("Scraping error:", error);
149} finally {
150await browser.close();
lineByLineEchomain.tsx1 match
1import serve, { events, forward, sleep } from "https://esm.town/v/jeffreyyoung/poe_bot?v=45";
23// this is a theoretical new api. Under the hood it uses secret unicode characters to help us easily know where to split the text
4// it implicitly ends the previous block
5function start_new_block(options: { type?: "thinking" | "tool" | "text" } = {}) {
288}
289290// --- Call the backend API ---
291const response = await fetch("/analyze-aircraft", { // Match server endpoint
292method: "POST",
779};
780781// --- API Route: /analyze-aircraft ---
782if (request.method === "POST" && new URL(request.url).pathname === "/analyze-aircraft") {
783try {
784// Check for OpenAI API Key in Val Town secrets (Val Town automatically injects process.env)
785// The library handles finding the key from secrets/env vars.
786899`;
900901// --- Call OpenAI API ---
902const response = await openai.chat.completions.create({
903model: modelChoice,
994<meta name="viewport" content="width=device-width, initial-scale=1.0">
995<meta charset="UTF-8">
996<link rel="preconnect" href="https://fonts.googleapis.com">
997<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
998<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Orbitron:wght@400;700&display=swap" rel="stylesheet">
999<style>
1000/* --- Base & Analyzer Styles --- */