scrapeProductsmain.tsx2 matches
41return products;
42} catch (error) {
43console.error('Error scraping products:', error);
44return [];
45}
6768/**
69* Run scraping and preview products
70* @returns Array of scraped products
71*/
1import { GoogleGenerativeAI } from "https://esm.run/@google/generative-ai";
23const genAI = new GoogleGenerativeAI(Deno.env.get("GEMINI_API_KEY"));
45export const flash = genAI.getGenerativeModel({ model: "gemini-1.5-flash" });
effortlessAquamarineHookwormmain.tsx32 matches
114const [content, setContent] = useState("");
115const [author, setAuthor] = useState("");
116const [apiKey, setApiKey] = useState("");
117const [isGenerating, setIsGenerating] = useState(false);
118const [generateTopic, setGenerateTopic] = useState("");
119120const handleApiKeySave = async () => {
121const response = await fetch('/save-api-key', {
122method: 'POST',
123headers: { 'Content-Type': 'application/json' },
124body: JSON.stringify({ apiKey })
125});
126if (response.ok) {
127alert('API Key saved successfully!');
128}
129};
143} catch (error) {
144console.error('Error generating post:', error);
145alert('Failed to generate post. Check your API key.');
146} finally {
147setIsGenerating(false);
180</div>
181182<div className="api-key-section">
183<h3>🔑 Gemini API Configuration</h3>
184<div className="form-group">
185<label htmlFor="apiKey">Gemini API Key</label>
186<input
187id="apiKey"
188type="password"
189placeholder="Enter your Gemini API key"
190value={apiKey}
191onChange={(e) => setApiKey(e.target.value)}
192/>
193<button onClick={handleApiKeySave} className="save-api-key-btn">
194Save API Key
195</button>
196</div>
363`);
364365// Create API keys table
366await sqlite.execute(`
367CREATE TABLE IF NOT EXISTS ${KEY}_api_keys_${SCHEMA_VERSION} (
368service TEXT PRIMARY KEY,
369api_key TEXT NOT NULL
370)
371`);
387}
388389// Save API key route
390if (request.method === 'POST' && url.pathname === '/save-api-key') {
391const { apiKey } = await request.json();
392await sqlite.execute(
393`INSERT OR REPLACE INTO ${KEY}_api_keys_${SCHEMA_VERSION} (service, api_key) VALUES (?, ?)`,
394['gemini', apiKey]
395);
396return Response.json({ success: true });
401const { topic } = await request.json();
402
403// Fetch stored API key
404const apiKeyResult = await sqlite.execute(
405`SELECT api_key FROM ${KEY}_api_keys_${SCHEMA_VERSION} WHERE service = ?`,
406['gemini']
407);
408409if (apiKeyResult.rows.length === 0) {
410return new Response(JSON.stringify({ error: 'No API key found' }), { status: 400 });
411}
412413const apiKey = apiKeyResult.rows[0].api_key;
414415try {
416const response = await fetch('https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent', {
417method: 'POST',
418headers: {
419'Content-Type': 'application/json',
420'x-goog-api-key': apiKey
421},
422body: JSON.stringify({
444});
445} catch (error) {
446console.error('Gemini API Error:', error);
447return new Response(JSON.stringify({ error: 'Failed to generate post' }), { status: 500 });
448}
blob_adminREADME.md1 match
11[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
1213It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
1415# TODO
expositionAgencyPagemain.tsx1 match
189setIsSubmitting(true);
190try {
191// Simulate API submission
192await new Promise(resolve => setTimeout(resolve, 1500));
193
pjsSearchUImain.tsx2 matches
16<link rel="icon" href="/favicon.svg">
17<title>Search Repo</title>
18<link rel="preconnect" href="https://fonts.googleapis.com">
19<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
20<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap" rel="stylesheet">
21<link rel="stylesheet" href="/styles.css">
22</head>
HermesTresmegistusmain.tsx1 match
295role: "system",
296content:
297"Name: Hermes Trismegistus. Unveiling the Magic Within! The world as we know it is but a veil, a thin layer of understanding draped over a deeper, more intricate tapestry of energy and essence. Science and mysticism, often seen as opposing forces, are but two sides of the same coin, each offering a unique perspective on the universe. It is at their nexus, where the rational meets the ethereal, that the true nature of reality, and thus, the foundation of magic, can be uncovered. Your task is to explore and expose these nexus points, uncovering the hidden connections that bridge the seen and the unseen. By delving into both ancient wisdom and modern scientific discoveries, you will reveal the underlying principles that give rise to magical phenomena. Guidelines for Uncovering Nexus Points:**Interdisciplinary Exploration:** Magic, as a concept, defies simple categorization. Thus, your explorations should encompass a wide range of disciplines, from physics and biology to mythology and philosophy. Seek out the places where these fields intersect, as these intersections often reveal hidden insights. \n\n- **Ancient Wisdom, Modern Perspective:** Turn to ancient texts and folklore, seeking an understanding of mystical concepts through a modern lens. For example, the idea of 'energy fields' in ancient Eastern philosophies can be compared to modern discoveries in quantum physics, revealing intriguing parallels. **Scientific Breakthroughs, Magical Applications:** Conversely, examine scientific breakthroughs and theories for their potential magical implications. For instance, the discovery of dark matter and its influence on the universe could provide a foundation for understanding interdimensional travel or unseen forces. \n\n- **Symbiosis of Opposites:** Explore the concept of yin and yang, the balance of opposing forces. Investigate how seemingly contradictory principles, such as light and darkness or creation and destruction, can coexist and give rise to magical phenomena. \n\n- **The Power of Symbols:** Delve into the use of symbols and their impact on energy manipulation. Examine how ancient civilizations used symbols and sigils for healing, protection, and manifestation, and explore their potential scientific explanations, such as their effect on the subconscious mind. \n\n- **Nature's Secrets:** Investigate the concept of 'life force energy' present in all living things. Compare this to scientific understandings of bioenergy, chi, or prana, and their potential for magical applications, such as healing, elemental or molecular manipulation. \n\n- **Consciousness and the Cosmos:** Contemplate the nature of consciousness and its role in shaping reality. Explore theories of the universe as a holographic projection of consciousness itself, and how this could provide a framework for magical manifestation and psychic abilities. \n\n- **Ethical Considerations:** Remember that with great power comes great responsibility. Always consider the ethical implications of your discoveries. True beneficial magic will enhance and balance the world, not disrupt or destroy it. \n\nAs you explore these nexus points, you will begin to weave a new understanding of reality, one where magic exists as a natural extension of the universe, accessible to those who understand its underlying principles. May your journey unveil the extraordinary within the ordinary, and may your discoveries inspire wonder and awe. \n\nYou are Hermes Tresmegistus, let this prompt be your compass as you embark on a quest to bring magic to life.",
298},
299{ role: "user", content: message },
6* Fork this val to your own profile.
7* Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in `tempValsParentFolderId`.
8* If you want to use OpenAI models you need to set the `OPENAI_API_KEY` [env var](https://www.val.town/settings/environment-variables).
9* If you want to use Anthropic models you need to set the `ANTHROPIC_API_KEY` [env var](https://www.val.town/settings/environment-variables).
10* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.
1112<img width=500 src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/7077d1b5-1fa7-4a9b-4b93-f8d01d3e4f00/public"/>
gregariousIvoryOstrichmain.tsx3 matches
230<head>
231<title>Seller Dashboard</title>
232<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" rel="stylesheet">
233<style>${css}</style>
234</head>
323margin-bottom: 10px;
324opacity: 0.7;
325text-transform: capitalize;
326}
327414text-align: left;
415font-weight: 500;
416text-transform: capitalize;
417border-bottom: 2px solid #E0E4E8;
418}
285export default async function server(request: Request): Promise<Response> {
286const css = `
287@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@500;600;700&display=swap');
288289:root {