Schedule posts to Bluesky with Cloudflare workers. skyscheduler.work
cf tool bsky-tool cloudflare bluesky schedule bsky service social-media cloudflare-workers

compress thumbs, add missing

also make edit post use the correct image size

+4 -4
assets/thumbs/gif.png

This is a binary file and will not be displayed.

assets/thumbs/image.png

This is a binary file and will not be displayed.

assets/thumbs/missing.png

This is a binary file and will not be displayed.

assets/thumbs/video.png

This is a binary file and will not be displayed.

+3 -3
src/endpoints/preview.tsx
··· 17 17 const { id } = c.req.param(); 18 18 const validation = FileContentSchema.safeParse({content: id}); 19 19 if (!validation.success) { 20 - return c.redirect("/thumbs/image.png"); 20 + return c.redirect("/thumbs/missing.png"); 21 21 } 22 22 23 23 const fetchedFile = await c.env.R2.get(id); 24 24 if (fetchedFile === null) { 25 - return c.redirect("/thumbs/image.png"); 25 + return c.redirect("/thumbs/missing.png"); 26 26 } 27 27 28 28 const contentType = fetchedFile.httpMetadata?.contentType || fetchedFile.customMetadata["type"]; 29 29 if (BSKY_IMG_MIME_TYPES.includes(contentType) === false) { 30 - return c.redirect("/thumbs/image.png"); 30 + return c.redirect("/thumbs/missing.png"); 31 31 } 32 32 33 33 const uploaderId = fetchedFile.customMetadata["user"];
+1 -1
src/layout/editPost.tsx
··· 16 16 17 17 return ( 18 18 <div class="editAltBlock" alteditfor={embedData.content}> 19 - <img width="128px" height="128px" class="editImgThumb" src={`preview/file/${embedData.content}`} /><br /> 19 + <img width="120px" height="120px" class="editImgThumb" src={`preview/file/${embedData.content}`} /><br /> 20 20 <center> 21 21 <input type="hidden" name={`altEdits.${num}.content`} value={embedData.content} /> 22 22 <input type="hidden" data-alt={true} name={`altEdits.${num}.alt`} value={embedData.alt} />