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/$%7BsvgDataUrl%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 9912 results for "image"(5030ms)

OpenAI310 words

https://docs.val.town/std/openai/
console.log(completion.choices[0].message.content); Images. Section titled “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

Sections

Images

Images. Section titled “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

Blob Storage414 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 scraping439 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. Section titled

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 page521 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 Deno728 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 SDK427 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'. }

Permissions935 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

huyhieumain.js3 matches

@lanlyUpdated 1 hour ago
86 const buffer = new Uint8Array(await res.arrayBuffer())
87 const base64 = btoa(String.fromCharCode(...buffer))
88 faviconDataUrl = `data:image/x-icon;base64,${base64}`
89 }
90 } catch {
134 ${badgeBg}
135 ${valueBg}
136 ${faviconDataUrl ? `<image x='${iconX}' y='${Math.round((s.height - s.icon) / 2)}' width='${s.icon}' height='${s.icon}' href='${faviconDataUrl}'/>` : ''}
137 ${labelText ? `<text x='${labelTextX}' y='${s.y}' fill='#333' text-anchor='${faviconDataUrl ? 'start' : 'middle'}'>${labelText}</text>` : ''}
138 ${valueText ? `<text x='${labelWidth + iconWidth + valueWidth / 2}' y='${s.y}' fill='${textColor}' text-anchor='middle'>${valueText}</text>` : ''}
140 `,
141 {
142 headers: { 'Content-Type': 'image/svg+xml' }
143 }
144 )

cardamonparse.ts16 matches

@connnollyUpdated 2 hours ago
71 tags: Array.isArray(recipe.tags) ? recipe.tags.filter(tag => typeof tag === "string") : undefined,
72 source: recipe.source && typeof recipe.source === "string" ? recipe.source.trim() : undefined,
73 imageUrl: recipe.imageUrl && typeof recipe.imageUrl === "string" ? recipe.imageUrl.trim() : undefined,
74 };
75}
125// System prompt for recipe parsing
126const RECIPE_PARSING_PROMPT =
127 `You are a recipe parsing expert. Your task is to extract structured recipe information from various sources (text, images, PDFs).
128
129IMPORTANT: You must return ONLY a valid JSON object with no additional text, markdown formatting, or explanations.
237});
238
239app.post("/image", async (c) => {
240 try {
241 const { content: base64Image } = await c.req.json() as ParseRequest;
242
243 console.log("Processing image upload, base64 length:", base64Image?.length);
244
245 // Validate base64 image
246 if (!base64Image || base64Image.length < 100) {
247 return c.json({ success: false, error: "Invalid or empty image data" } as ParseResponse);
248 }
249
250 // Use OpenAI Vision to parse recipe from image
251 const completion = await openai.chat.completions.create({
252 model: "gpt-4o-mini",
259 type: "text",
260 text:
261 "Parse the recipe from this image. Extract all visible recipe information including title, ingredients with amounts, and cooking steps.",
262 },
263 {
264 type: "image_url",
265 image_url: {
266 url: base64Image.startsWith("data:") ? base64Image : `data:image/jpeg;base64,${base64Image}`,
267 },
268 },
306 const rawRecipe = JSON.parse(jsonText);
307 const recipe = validateAndCleanRecipe(rawRecipe);
308 recipe.source = "Image upload";
309
310 return c.json({ success: true, recipe } as ParseResponse);
318 }
319 } catch (error) {
320 console.error("Image parsing error:", error);
321 return c.json({
322 success: false,
323 error: `Failed to parse recipe from image: ${error.message}`,
324 } as ParseResponse);
325 }
compare-images

compare-images2 file matches

@eeepsUpdated 2 days ago
Compare two images and show some metadata about ’em

pdf-image1 file match

@stevekrouseUpdated 2 days ago
Chrimage
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