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/$%7Bsuccess?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 6272 results for "image"(950ms)

FeedPondreceiveCreation.js5 matches

@elouan•Updated 1 hour ago
53 const finalType = typeof type === "string" ? type.trim() : "unknown";
54 const creation_time = time; // Use the provided timestamp
55 // Construct the image URL and link based on the main Pondiverse structure
56 const image_url = `https://pondiverse.val.run/get-creation-image?id=${original_id}`;
57 const link = `${UPSTREAM_PONDIVERSE_URL}/explore/#c${original_id}`;
58
61 await sqlite.execute({
62 sql: `
63 INSERT INTO ${AGGREGATOR_TABLE_NAME} (original_id, title, type, creation_time, image_url, link)
64 VALUES (:original_id, :title, :type, :creation_time, :image_url, :link)
65 `,
66 args: {
69 type: finalType,
70 creation_time: creation_time,
71 image_url: image_url,
72 link: link,
73 },

FeedPonddb.js1 match

@elouan•Updated 1 hour ago
14 type TEXT,
15 creation_time DATETIME NOT NULL, /* Time from the main Pondiverse */
16 image_url TEXT, /* Direct URL to the main pondiverse image */
17 link TEXT UNIQUE NOT NULL, /* Link to the creation on the main site */
18 received_time DATETIME DEFAULT CURRENT_TIMESTAMP /* When this aggregator received it */

FeedPondgenerateRSS.js3 matches

@elouan•Updated 1 hour ago
28 const results = await sqlite.execute({
29 // Fetch recent items, ordered by original creation time
30 sql: `SELECT title, type, creation_time, image_url, link
31 FROM ${AGGREGATOR_TABLE_NAME}
32 ORDER BY creation_time DESC
37 for (const item of results.rows) {
38 const pubDate = new Date(item.creation_time).toUTCString();
39 // Create description with type and image preview
40 const description = `<![CDATA[
41 <p>Type: ${escapeXml(item.type)}</p>
42 ${item.image_url ? `<p><img src="${escapeXml(item.image_url)}" alt="Thumbnail" style="max-width: 300px; max-height: 200px;" /></p>` : ''}
43 <p><a href="${escapeXml(item.link)}">View Creation Details</a></p>
44 ]]>`;

untitled-6323new-file-8750.tsx4 matches

@wahobd•Updated 2 hours ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function Slideshow({ images }) {
6 useEffect(() => {
7 let currentSlideIndex = 0;
57 return (
58 <div className="slideshow-container">
59 {images.map((src, index) => (
60 <img key={index} className={`mySlides ${index === 0 ? 'visible' : ''}`} src={src} alt={`Slide ${index + 1}`} />
61 ))}
286 }, []);
287
288 const slideshowImages = [
289 "https://i.postimg.cc/KvSbQsgQ/download-4.png",
290 "https://i.postimg.cc/NMzVyLRp/download-5.png",
354 </div>
355 </div>
356 <Slideshow images={slideshowImages} />
357 <Card {...loginCardData} />
358 <Card {...scanCodeCardData} />

stevensDemoREADME.md1 match

@kuanche•Updated 5 hours ago
3It's common to have code and types that are needed on both the frontend and the backend. It's important that you write this code in a particularly defensive way because it's limited by what both environments support:
4
5![shapes at 25-02-25 11.57.13.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/75db1d51-d9b3-45e0-d178-25d886c10700/public)
6
7For example, you *cannot* use the `Deno` keyword. For imports, you can't use `npm:` specifiers, so we reccomend `https://esm.sh` because it works on the server & client. You *can* use TypeScript because that is transpiled in `/backend/index.ts` for the frontend. Most code that works on the frontend tends to work in Deno, because Deno is designed to support "web-standards", but there are definitely edge cases to look out for.

stevensDemoREADME.md1 match

@kuanche•Updated 5 hours ago
21## `favicon.svg`
22
23As of this writing Val Town only supports text files, which is why the favicon is an SVG and not an .ico or any other binary image format. If you need binary file storage, check out [Blob Storage](https://docs.val.town/std/blob/).
24
25## `components/`

stevensDemoindex.ts15 matches

@kuanche•Updated 5 hours 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 );

stevensDemoindex.html3 matches

@kuanche•Updated 5 hours ago
10 href="/public/favicon.svg"
11 sizes="any"
12 type="image/svg+xml"
13 />
14 <link rel="preconnect" href="https://fonts.googleapis.com" />
36 height: 100%;
37 font-family: "Pixelify Sans", sans-serif;
38 image-rendering: pixelated;
39 }
40 body::before {
50 /* For pixel art aesthetic */
51 * {
52 image-rendering: pixelated;
53 }
54 </style>

stevensDemohandleUSPSEmail.ts12 matches

@kuanche•Updated 5 hours 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 }

stevensDemo.cursorrules2 matches

@kuanche•Updated 5 hours ago
187## Val Town Platform Specifics
188- **Redirects:** Use `return new Response(null, { status: 302, headers: { Location: "/place/to/redirect" }})` instead of `Response.redirect` which is broken
189- **Images:** Avoid external images or base64 images. Use emojis, unicode symbols, or icon fonts/libraries instead
190- For AI-generated images, use: `https://maxm-imggenurl.web.val.run/the-description-of-your-image`
191- **Storage:** DO NOT use the Deno KV module for storage
192- **Browser APIs:** DO NOT use the `alert()`, `prompt()`, or `confirm()` methods

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