9 <head>
10 <title>Today for Annalisa 🥹</title>
11 <link rel="icon" type="image/svg+xml" href="data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%3E%3C%2Fcircle%3E%3Cline%20x1%3D%2212%22%20y1%3D%2216%22%20x2%3D%2212%22%20y2%3D%2212%22%3E%3C%2Fline%3E%3Cline%20x1%3D%2212%22%20y1%3D%2212%22%20x2%3D%2216%22%20y2%3D%2212%22%3E%3C%2Fline%3E%3Cline%20x1%3D%2212%22%20y1%3D%2212%22%20x2%3D%2210%22%20y2%3D%2212%22%3E%3C%2Fline%3E%3C%2Fsvg%3E" />
12 <meta name="description" content="Today for Annalisa 🥹" />
13 <meta name="description" content="Today for Annalisa 🥹" />
17 <meta property="og:title" content="Today for Annalisa 🥹" />
18 <meta property="og:description" content="Today for Annalisa 🥹" />
19 <meta property="og:image" content="https://picsum.photos/1200/630" />
20 <meta property="og:url" content="https://mttlws-todayforannalisa.express.val.run" />
21 <meta property="og:type" content="website" />
22 <meta property="twitter:title" content="Today for Annalisa 🥹" />
23 <meta property="twitter:description" content="Today for Annalisa 🥹" />
24 <meta property="twitter:image" content="https://picsum.photos/1200/630" />
25 <style>
26 body {
1export let tempImageVal = {
2 "test": "img",
3 "test2": "img2",
447 "https://www.itraveljerusalem.com/article/israel-egypt-taba-border-crossing",
448 "https://www.itraveljerusalem.com/article/israeli-currency",
449 "https://www.itraveljerusalem.com/article/israel-and-pilgrimage-maps",
450 "https://www.itraveljerusalem.com/article/israel-visas-consulates",
451 "https://www.itraveljerusalem.com/article/jerusalem-day",
14 username: string;
15 bio: string;
16 profileImageUrl: string;
17};
18type ValResult = {
3export let canvasText = (async (req: Request) => {
4 const query = new URL(req.url).searchParams;
5 const { loadImage, createCanvas } = await import(
6 "https://deno.land/x/canvas/mod.ts"
7 );
117 ctx.arc(184, 352 - 240, 8, 0, 2 * Math.PI);
118 ctx.fill();
119 // image
120 const { fetchRemote } = await import(
121 "https://deno.land/x/fetchbase64@1.0.0/mod.ts"
122 );
123 const imgBase64 = await fetchRemote(query.get("img"));
124 ctx.imageSmoothingEnabled = false;
125 const img = await loadImage(imgBase64);
126 ctx.drawImage(img, 156, 174, 100, 100);
127 // headline
128 ctx.fillStyle = "#ffffff";
293 return new Response(canvas.toBuffer(), {
294 headers: {
295 "Content-Type": "image/png",
296 },
297 });
3
4export const elevenlabsTTS = async (req, res) => {
5 // https://platform.openai.com/docs/api-reference/images/create
6 // https://ale_annini-elevenlabstts.express.val.run/?args=[%22{\%22text\%22:\%22it%20beautiful\%22}%22]
7 const payload = {
3export const dighimapperMultipleMaps = (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();
8 let imageIds = new Set();
9 let imageIdsMultipleMaps = new Set();
10 for (let annotation of annotations.items) {
11 const imageId = annotation.target.service[0]["@id"];
12 if (imageIds.has(imageId)) {
13 imageIdsMultipleMaps.add(imageId);
14 }
15 imageIds.add(imageId);
16 }
17 return [...imageIdsMultipleMaps];
18})();
40 pixelData.push(data);
41 res.set("Cache-Control", "no-cache, no-store, must-revalidate, max-age=0");
42 await randomGenerator(req, res); // res.set("Content-Type", "image/svg+xml");
43 // res.redirect("http://delian.io/transparent_pixel.png");
44 // return data;
3export const keepCloudClassifierWarmV4 = async () => {
4 const imgDataUrl =
5 "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
6 const response = await fetch(
7 "https://kaicathy-cloudid.hf.space/run/predict",
1import { socialImageUsageCSS } from "https://esm.town/v/tylergaw/socialImageUsageCSS";
2
3export const socialImageUsage = () => {
4 const img =
5 "https://tylergaw-socialimage.web.val.run/?bg=%23a2fa00&text=Building%20an%20Image%20Generator%20with%20Val%20Town";
6 const html = `
7<html>
8 <meta property="og:image" content="${img}">
9 <meta name="twitter:image" content="${img}">
10 <meta name="twitter:card" content="summary_large_image">
11 <title>Val Town: Image generator example usage</title>
12 <style>${socialImageUsageCSS}</style>
13 <body>
14 <h1>Image generator Example</h1>
15 <p>See <a href="https://www.val.town/v/tylergaw.socialImage">https://www.val.town/v/tylergaw.socialImage</a></p>
16
17 <ul>
18 <li><img src="https://tylergaw-socialimage.web.val.run/?bg=%23fa2500&text=Smol&color=white&w=500&h=300"></li>
19 <li><img src="https://tylergaw-socialimage.web.val.run/?bg=%23f6fa00&text=square&w=600&h=600"></li>
20 </ul>
21 </body>