Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$1?q=openai&page=38&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=openai

Returns an array of strings in format "username" or "username/projectName"

Found 2151 results for "openai"(1156ms)

ReactNewsletterREADME.md5 matches

@shakirul•Updated 2 weeks ago
14
15- `NEWSLETTER_RECIPIENT_EMAIL`: The email address where the newsletter will be sent
16- `OPENAI_API_KEY`: For generating content (automatically provided by Val Town)
17- `GITHUB_TOKEN` (optional): A GitHub personal access token to avoid rate limiting when fetching trending repositories
18
35The newsletter uses:
36
37- OpenAI to generate unique React/JS/TS knowledge tips
38- React's blog API to fetch the latest React news (with OpenAI as a fallback)
39- GitHub's API to find trending repositories related to React/JS/TS
40- Val Town's email functionality to send the formatted newsletter
44You can customize the newsletter by modifying the `daily-react-newsletter.ts` file:
45
46- Adjust the OpenAI prompts to get different types of content
47- Change the email template design
48- Modify the GitHub search query to find different types of repositories
551. Check the logs in Val Town to see any error messages
562. Verify that all environment variables are set correctly
573. Ensure your OpenAI API key has sufficient quota
584. If GitHub API requests are failing, consider adding a GitHub token

ReactNewsletterdaily-react-newsletter.ts10 matches

@shakirul•Updated 2 weeks ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { email } from "https://esm.town/v/std/email";
3
4// Function to generate React/JS/TS knowledge using OpenAI
5async function generateReactKnowledge(): Promise<string> {
6 const openai = new OpenAI();
7 const prompt = "Share one useful but lesser-known fact or technique about React, JavaScript, or TypeScript that most developers don't know. Explain it concisely with a small code example if applicable.";
8
9 const completion = await openai.chat.completions.create({
10 messages: [{ role: "user", content: prompt }],
11 model: "gpt-4o-mini",
37 console.error("Error fetching React news:", error);
38
39 // Fallback to OpenAI for React news if the API fails
40 const openai = new OpenAI();
41 const prompt = "What's a recent development or news in the React ecosystem? Provide a brief summary of something new or upcoming in the React world from the past month.";
42
43 const completion = await openai.chat.completions.create({
44 messages: [{ role: "user", content: prompt }],
45 model: "gpt-4o-mini",
80 console.error("Error fetching trending repos:", error);
81
82 // Fallback to OpenAI for trending repos if the API fails
83 const openai = new OpenAI();
84 const prompt = "What's a trending GitHub repository related to React, JavaScript, or TypeScript that's gaining popularity? Provide the name, a brief description, and what makes it interesting.";
85
86 const completion = await openai.chat.completions.create({
87 messages: [{ role: "user", content: prompt }],
88 model: "gpt-4o-mini",

Townie-06system_prompt.txt4 matches

@jxnblk•Updated 2 weeks ago
88Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
89
90### OpenAI
91
92```ts
93import { OpenAI } from "https://esm.town/v/std/openai";
94const openai = new OpenAI();
95const completion = await openai.chat.completions.create({
96 messages: [
97 { role: "user", content: "Say hello in a creative way" },

Townie-06.cursorrules4 matches

@jxnblk•Updated 2 weeks ago
94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
95
96### OpenAI
97
98```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102 messages: [
103 { role: "user", content: "Say hello in a creative way" },

stevensDemo.cursorrules4 matches

@codingayam•Updated 2 weeks ago
100Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
101
102### OpenAI
103```ts
104import { OpenAI } from "https://esm.town/v/std/openai";
105const openai = new OpenAI();
106const completion = await openai.chat.completions.create({
107 messages: [
108 { role: "user", content: "Say hello in a creative way" },

MapminderREADME.md3 matches

@dexy•Updated 2 weeks ago
14
151. The app runs daily via a cron trigger
162. It uses OpenAI to generate fresh, relevant content for each category
173. The content is formatted into a clean, readable email
184. The email is automatically sent to the Val Town account owner
38
39This app uses:
40- OpenAI API (via Val Town's standard library)
41- Email functionality (via Val Town's standard library)
42
47If emails are not being received:
481. Check the Val Town logs for any errors
492. Verify that the OpenAI API is functioning correctly
503. Ensure your email settings in Val Town are configured properly
51

Mapminderdaily-insights-email.ts4 matches

@dexy•Updated 2 weeks ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { email } from "https://esm.town/v/std/email";
3
18
19/**
20 * Generates business and tech insights using OpenAI
21 */
22async function generateInsights() {
23 const openai = new OpenAI();
24 const insights: Record<string, string[]> = {};
25
45
46 try {
47 const completion = await openai.chat.completions.create({
48 messages: [{ role: "user", content: prompt }],
49 model: "gpt-4o-mini",

stevensDemo.cursorrules4 matches

@codingayam•Updated 2 weeks ago
100Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
101
102### OpenAI
103```ts
104import { OpenAI } from "https://esm.town/v/std/openai";
105const openai = new OpenAI();
106const completion = await openai.chat.completions.create({
107 messages: [
108 { role: "user", content: "Say hello in a creative way" },

pageexplainerREADME.md3 matches

@neverstew•Updated 2 weeks ago
7- Fetches the source of any webpage
8- Extracts HTML, CSS, and JavaScript content
9- Uses OpenAI to analyze the page and answer questions about it
10- Provides a simple, user-friendly web interface
11- Also supports JSON API for programmatic usage
74- JavaScript evaluation is limited to static analysis (the Val cannot execute JavaScript)
75- External resources like images, videos, or dynamically loaded content may not be fully analyzed
76- The analysis depends on the capabilities of the OpenAI model being used
77
78## Requirements
79
80This Val requires an OpenAI API key to be set as an environment variable in your Val Town account.

pageexplainerwebpage-analyzer.ts7 matches

@neverstew•Updated 2 weeks ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3/**
4 * Webpage Analyzer
5 *
6 * This Val fetches a webpage, extracts its content, and uses OpenAI to answer
7 * questions about the page based on its HTML, CSS, and JavaScript.
8 */
9
10// Initialize OpenAI client
11const openai = new OpenAI();
12
13// Helper function to extract JavaScript from HTML
122
123 <footer class="mt-8 text-center text-gray-500 text-sm">
124 <p>Powered by Val Town and OpenAI</p>
125 <p class="mt-1">
126 <a href="${import.meta.url.replace("esm.sh", "val.town")}" target="_top" class="text-blue-500 hover:underline">View Source</a>
232 };
233
234 // Use OpenAI to analyze the content and answer the question
235 console.log(`Analyzing webpage and answering question: ${question}`);
236 const completion = await openai.chat.completions.create({
237 model: "gpt-4o",
238 messages: [

openai-client1 file match

@cricks_unmixed4u•Updated 3 days ago

openai_enrichment6 file matches

@stevekrouse•Updated 4 days ago
kwhinnery_openai
reconsumeralization
import { OpenAI } from "https://esm.town/v/std/openai"; import { sqlite } from "https://esm.town/v/stevekrouse/sqlite"; /** * Practical Implementation of Collective Content Intelligence * Bridging advanced AI with collaborative content creation */ exp