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/$%7Bart_info.art.src%7D?q=image&page=1&format=json

For typeahead suggestions, use the /typeahead endpoint:

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

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

Found 6257 results for "image"(795ms)

OpenAI300 words

https://docs.val.town/std/openai/
30, }); console.log(completion.choices[0].message.content); Images. To send an image to ChatGPT, the easiest way is by converting it to a data URL, which is easiest to do with @stevekrouse/fileToDataURL. Image ExampleRun

Sections

Images

Images. To send an image to ChatGPT, the easiest way is by converting it to a data URL, which is easiest to do with @stevekrouse/fileToDataURL. Image ExampleRun in Val Town

Blob Storage366 words

https://docs.val.town/std/blob/
comes with blob storage built-in. It allows for storing any data, like text, JSON, or images. You can access it via std/blob. Blob storage is scoped globally to your account.

Sections

Blob Storage

comes with blob storage built-in. It allows for storing any data, like text, JSON, or images. You can access it via std/blob. Blob storage is scoped globally to your account.

Web scraping416 words

https://docs.val.town/guides/web-scraping/
outperform humans at most economically valuable work".[10] OpenAI has developed several large language models, advanced image generation models, and previously, also open-source models.[11][12] API call to external services. See the

Sections

Parsing HTML

outperform humans at most economically valuable work".[10] OpenAI has developed several large language models, advanced image generation models, and previously, also open-source models.[11][12]

Saving data from a web page513 words

https://docs.val.town/guides/saving-data-from-a-web-page/
has two built-in: Blob storage is a very simple key-value store for storing files, JSON, images, large blobs of data, while SQLite is a SQL database with ACID transactions, indexes,

Sections

Saving data from a web page

has two built-in: Blob storage is a very simple key-value store for storing files, JSON, images, large blobs of data, while SQLite is a SQL database with ACID transactions, indexes,

Upgrade to Deno633 words

https://docs.val.town/upgrading/upgrade-to-deno/
for the browser-standard Response type that is the result of a fetch request. The following image shows all three types used in parallel: req.body is no longer overloaded by req.query.

Sections

ExpressJS types moved to express namespace

for the browser-standard Response type that is the result of a fetch request. The following image shows all three types used in parallel:

JavaScript SDK414 words

https://docs.val.town/api/sdk/
and get your profile information: Running index.mjs and getting profile information node index.mjs. { id: '19892fed-baf3-41fb-a5cc-96c80e95edec', bio: '👷 Building Val Town', username: 'tmcw', profileImageUrl: 'https://img.clerk.com/eyJ0eXBl…', tier: 'pro', email: 'tom@macwright.com'. }

Sections

Getting started in Node.js

and get your profile information: Running index.mjs and getting profile information node index.mjs. { id: '19892fed-baf3-41fb-a5cc-96c80e95edec', bio: '👷 Building Val Town', username: 'tmcw', profileImageUrl: 'https://img.clerk.com/eyJ0eXBl…', tier: 'pro', email: 'tom@macwright.com'. }

Permissions899 words

https://docs.val.town/reference/permissions/
(req.get("auth") !== process.env.clerkNonSensitive). return res.end("Unauthorized"); await discordWebhook({ url: Deno.env.get("discordUserEvents"), content: req.body.data.email_addresses[0].email_address + " " + req.body.data.profile_image_url, }); res.end("Success"); } I call this value clerkNonSensitive because this value doesn’t protect any

Sections

Custom Authentication

(req.get("auth") !== process.env.clerkNonSensitive). return res.end("Unauthorized"); await discordWebhook({ url: Deno.env.get("discordUserEvents"), content: req.body.data.email_addresses[0].email_address + " " + req.body.data.profile_image_url, }); res.end("Success"); } I call this value clerkNonSensitive because this value doesn’t protect any

a4595dc5b24_index.ts15 matches

@vtTestLocal•Updated 54 mins ago
73});
74
75// --- Blob Image Serving Routes ---
76
77// GET /api/images/:filename - Serve images from blob storage
78app.get("/api/images/:filename", async (c) => {
79 const filename = c.req.param("filename");
80
81 try {
82 // Get image data from blob storage
83 const imageData = await blob.get(filename);
84
85 if (!imageData) {
86 return c.json({ error: "Image not found" }, 404);
87 }
88
90 let contentType = "application/octet-stream"; // Default
91 if (filename.endsWith(".jpg") || filename.endsWith(".jpeg")) {
92 contentType = "image/jpeg";
93 } else if (filename.endsWith(".png")) {
94 contentType = "image/png";
95 } else if (filename.endsWith(".gif")) {
96 contentType = "image/gif";
97 } else if (filename.endsWith(".svg")) {
98 contentType = "image/svg+xml";
99 }
100
101 // Return the image with appropriate headers
102 return new Response(imageData, {
103 headers: {
104 "Content-Type": contentType,
107 });
108 } catch (error) {
109 console.error(`Error serving image ${filename}:`, error);
110 return c.json(
111 { error: "Failed to load image", details: error.message },
112 500,
113 );

a4595dc5b24_handleUSPSEmail.ts12 matches

@vtTestLocal•Updated 54 mins ago
12}
13
14type ImageSummary = {
15 sender: string;
16 recipient: (typeof RECIPIENTS)[number] | "both" | "other";
22 anthropic: Anthropic,
23 htmlContent: string,
24 imageSummaries: ImageSummary[]
25) {
26 try {
36 text: `Analyze the following content from an email and provide a response as a JSON blob (only JSON, no other text) with two parts.
37
38 The email is from the USPS showing mail I'm receiving. Metadata about packages is stored directly in the email. Info about mail pieces is in images, so I've included summaries of those as well.
39
40 Your response should include:
66 And here is info about the mail pieces:
67
68 ${JSON.stringify(imageSummaries)}`,
69 },
70 ],
95 const anthropic = new Anthropic({ apiKey });
96
97 // Process each image attachment serially
98 const summaries = [];
99 for (const [index, attachment] of e.attachments.entries()) {
100 try {
101 const imageData = await attachment.arrayBuffer();
102 const base64Image = btoa(
103 String.fromCharCode(...new Uint8Array(imageData))
104 );
105
112 content: [
113 {
114 type: "image",
115 source: {
116 type: "base64",
117 media_type: attachment.type,
118 data: base64Image,
119 },
120 },
148 summaries.push(parsedResponse);
149 } catch (error) {
150 console.error(`Image analysis error:`, error);
151 summaries.push({
152 sender: "Error",
153 recipient: "Error",
154 type: "error",
155 notes: `Image ${index + 1} Analysis Failed: ${error.message}`,
156 });
157 }

brainrot_image_gen1 file match

@dcm31•Updated 1 week ago
Generate images for Italian Brainrot characters using FAL AI

modifyImage2 file matches

@stevekrouse•Updated 1 week ago
Atiq
"Focal Lens with Atig Wazir" "Welcome to my photography journey! I'm Atiq Wazir, a passionate photographer capturing life's beauty one frame at a time. Explore my gallery for stunning images, behind-the-scenes stories, and tips & tricks to enhance your own