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();
4export async function sendRandomChihuahuaToSlack() {
5 const dogAPIURL = new URL(
6 "https://dog.ceo/api/breed/chihuahua/images/random",
7 );
8 const dogApiResp = await fetch(dogAPIURL.href);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export const textToImageDalle = async (
4 openAIToken: string,
5 prompt: string,
17 };
18 } = await fetchJSON(
19 "https://api.openai.com/v1/images/generations",
20 {
21 method: "POST",
33 return json;
34};
35// Forked from @hootz.textToImageDalle
18 }
19 const { qrcode } = await import("https://deno.land/x/qrcode/mod.ts");
20 const base64Image = await qrcode(url);
21 res.send(
22 `<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>`,
23 );
24}