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 },
24 username: string;
25 bio: string;
26 profileImageUrl: string;
27};
28type ValResult = {
2import { thisEmail } from "https://esm.town/v/stevekrouse/thisEmail?v=3";
3import { email as email2 } from "https://esm.town/v/stevekrouse/email?v=15";
4import { dalleImageUrl } from "https://esm.town/v/andreterron/dalleImageUrl";
5
6export async function dallemail(email) {
7 let imageUrl = await dalleImageUrl(email.text);
8 return email2({
9 to: email.from,
10 from: thisEmail(),
11 subject: "Re: " + email.subject,
12 html: `<img src="${imageUrl}" style="width: 256px;"/>`,
13 }, exportedKeys);
14}
4 "to": ["stevekrouse.morning_disc_collector@valtown.email"],
5 "subject": "Fwd: [Morning disc] Fri AM Disc - PG Grass - Need 4",
6 "text": "---------- Forwarded message ---------\r\nFrom: Jon Sands <sands.jonathan@gmail.com>\r\nDate: Thu, Sep 21, 2023 at 1:20āÆPM\r\nSubject: [Morning disc] Fri AM Disc - PG Grass - Need 4\r\nTo: <morning-disc@googlegroups.com>\r\n\r\n\r\n [image: image]\r\n\r\n\r\nOn Sep 21, 2023, at 9:23 AM, Jon Sands <sands.jonathan@gmail.com> wrote:\r\n\r\nFriends, weāre looking at a majestic 62 degrees with 8mph winds coming out\r\nof the Northeast. Itās the first Friday morning of fall, letās make it a\r\nbig one. Donāt keep that RSVP to yourself, set it free!\r\n\r\nWhoās in?\r\n\r\n\r\n\r\n\r\n\r\nAuthor of *It's Not Magic <http://jonsands.com/store/its-not-magic/> *from\r\nBeacon Press\r\n\r\nHere I am: www.jonsands.com\r\nwww.instagram.com/iAmJonSands <http://www.instagram.com/iAmJonSands>\r\n(he/him/his)\r\n\r\n-- \r\nYou received this message because you are subscribed to the Google Groups\r\n\"Morning disc\" group.\r\nTo unsubscribe from this group and stop receiving emails from it, send an\r\nemail to morning-disc+unsubscribe@googlegroups.com.\r\nTo view this discussion on the web visit\r\nhttps://groups.google.com/d/msgid/morning-disc/FED84DE5-E999-4D02-BFA8-A3F214CD25C4%40gmail.com\r\n<https://groups.google.com/d/msgid/morning-disc/FED84DE5-E999-4D02-BFA8-A3F214CD25C4%40gmail.com?utm_medium=email&utm_source=footer>\r\n.\r\n",
7 "html": "<div dir=\"ltr\"><br><br><div class=\"gmail_quote\"><div dir=\"ltr\" class=\"gmail_attr\">---------- Forwarded message ---------<br>From: <strong class=\"gmail_sendername\" dir=\"auto\">Jon Sands</strong> <span dir=\"auto\"><<a href=\"mailto:sands.jonathan@gmail.com\">sands.jonathan@gmail.com</a>></span><br>Date: Thu, Sep 21, 2023 at 1:20āÆPM<br>Subject: [Morning disc] Fri AM Disc - PG Grass - Need 4<br>To: <<a href=\"mailto:morning-disc@googlegroups.com\">morning-disc@googlegroups.com</a>><br></div><br><br><div dir=\"auto\"><div dir=\"ltr\"> <img src=\"cid:7C896CD2-878C-4F09-AF6A-E154B9EC4101\" alt=\"image\"><br><br><div dir=\"ltr\"><blockquote type=\"cite\"><br>On Sep 21, 2023, at 9:23 AM, Jon Sands <<a href=\"mailto:sands.jonathan@gmail.com\" target=\"_blank\">sands.jonathan@gmail.com</a>> wrote:<br><br></blockquote></div><blockquote type=\"cite\"><div dir=\"ltr\">Friends, weāre looking at a majestic 62 degrees with 8mph winds coming out of the Northeast. Itās the first Friday morning of fall, letās make it a big one. Donāt keep that RSVP to yourself, set it free!Ā <div><br></div><div>Whoās in?Ā </div><div><br></div><div><br><br><div dir=\"ltr\"><br><div><div><br></div><div><div><span style=\"background-color:rgba(255,255,255,0)\">Author ofĀ <i><a href=\"http://jonsands.com/store/its-not-magic/\" target=\"_blank\">It's Not Magic</a>Ā </i>from Beacon Press</span></div><div><span style=\"background-color:rgba(255,255,255,0)\"><br></span></div><span style=\"background-color:rgba(255,255,255,0)\">Here I am:Ā <a href=\"http://www.jonsands.com/\" target=\"_blank\">www.jonsands.com</a></span><div><a href=\"http://www.instagram.com/iAmJonSands\" style=\"background-color:rgba(255,255,255,0)\" target=\"_blank\"><font color=\"#000000\">www.instagram.com/iAmJonSandsĀ </font></a></div><div><span style=\"background-color:rgba(255,255,255,0)\">(he/him/his)</span></div></div></div></div></div></div></blockquote></div></div>\r\n\r\n<p></p>\r\n\r\n-- <br>\r\nYou received this message because you are subscribed to the Google Groups "Morning disc" group.<br>\r\nTo unsubscribe from this group and stop receiving emails from it, send an email to <a href=\"mailto:morning-disc+unsubscribe@googlegroups.com\" target=\"_blank\">morning-disc+unsubscribe@googlegroups.com</a>.<br>\r\nTo view this discussion on the web visit <a href=\"https://groups.google.com/d/msgid/morning-disc/FED84DE5-E999-4D02-BFA8-A3F214CD25C4%40gmail.com?utm_medium=email&utm_source=footer\" target=\"_blank\">https://groups.google.com/d/msgid/morning-disc/FED84DE5-E999-4D02-BFA8-A3F214CD25C4%40gmail.com</a>.<br>\r\n</div></div>\r\n"
8}];
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchImageAsBase64(url) {
4 const response = await fetch(url);
5 const blob = await response.blob();
3export const dighimapperGcpCount = (async () => {
4 const url =
5 "https://annotations.allmaps.org/maps?imageservicedomain=images.dighimapper.eu";
6 const reponse = await fetch(url);
7 const annotations = await reponse.json();