1import { nasaImageDetails } from "https://esm.town/v/wallek/nasaImageDetails";
2
3// View at https://wallek-nasaImage.web.val.run
4export async function nasaImage() {
5 const { html } = await nasaImageDetails();
6 return new Response(html, {
7 headers: { "Content-Type": "text/html" },
7 content: thread.com,
8 replies: thread.replies,
9 images: thread.images,
10 }));
11};
1export function nft(name, description, image) {
2 return {
3 "name": name,
4 "symbol": "Tipstarter",
5 "description": description,
6 "image": image,
7 "external_url": "",
8 "attributes": [],
10 }
11 const { qrcode } = await import("https://deno.land/x/qrcode/mod.ts");
12 const base64Image = await qrcode(url);
13 res.send(
14 `<html><body><img src=${base64Image} height="100px" width="100px" /><p style="font-size:10px">QR Code generated using <a href="https://val.town">val.town</a></p><p style="font-size:10px">Built with 💗 by <a href="https://twitter.com/Ramkarthik">Ramkarthik</a></p></body></html>`,
15 );
16}
72 }
73 form.charsheet ul li {
74 list-style-image: none;
75 display: block;
76 }
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function checkBPPRequirement(imageUrl, minWidth, minHeight) {
4 try {
5 const response = await fetch(imageUrl);
6 const buffer = await response.arrayBuffer();
7 const totalPixels = minWidth * minHeight;
14 console.log(`Actual Bytes: ${actualBytes} bytes`);
15 if (actualBytes >= minBytes) {
16 console.log("👏 Image meets BPP requirement.");
17 return true;
18 }
19 else {
20 console.log("🙁 Image does not meet BPP requirement.");
21 return false;
22 }
23 }
24 catch (error) {
25 console.error("❌ Error fetching image:", error.message);
26 }
27}
1export let embedBirdSound = async (req, res) => {
2 const [title, file, image] = req.query.args.split(",");
3 res.send(
4 `<div style="text-align: center;"><h3 style="font-size: 5rem; margin: 5rem auto;">${title}</h3><img style="display: block; width: 50vw; margin: 0 auto;" src="${image}" /><audio controls src="${file}" style="width: 50vw; margin: 0 auto 5rem;"></audio></div>`
5 );
6};
8) => {
9 const rssItems = previousDjs.map((dj) => {
10 const djImgSrc = `https://r-a-d.io/api/dj-image/${encodeURIComponent(
11 dj.djimage
12 )}`;
13 const djMessage =
8 username: string;
9 bio: string;
10 profileImageUrl: string;
11}> =>
12 fetchJSON(`https://api.val.town/v1/users/${id}`, {
51 followers: `https://${DOMAIN}/u/bot/followers`,
52 icon: {
53 type: "Image",
54 mediaType: "image/jpeg",
55 url: "https://macwright.com/graphics/about.jpg",
56 },