Schedule posts to Bluesky with Cloudflare workers. skyscheduler.work
cf tool bsky-tool cloudflare bluesky schedule bsky service social-media cloudflare-workers
at main 28 lines 777 B view raw
1import { Context } from "hono"; 2import isEmpty from "just-is-empty"; 3import { Post } from "../classes/post"; 4import { getPostsForUser } from "../utils/dbQuery"; 5import { PostHTML } from "./post"; 6 7type ScheduledPostListProps = { 8 ctx?: Context; 9}; 10 11export const ScheduledPostList = async ({ctx}: ScheduledPostListProps) => { 12 if (ctx !== undefined) { 13 const response: Post[]|null = await getPostsForUser(ctx); 14 if (!isEmpty(response)) { 15 return (<> 16 <a hidden tabindex={-1} class="invalidateTab hidden"></a> 17 {response!.map((data: Post) => { 18 return <PostHTML post={data} />; 19 })} 20 </>); 21 } 22 } 23 24 return (<article> 25 <a hidden tabindex={-1} class="invalidateTab hidden"></a> 26 <p>No posts scheduled</p> 27 </article>); 28};