An API you can curl, or open in a browser, to receive Bluesky data as markdown!
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

Wrap OG body copy to keep text inside the frame

j4ck.xyz f737428b 924a9db8

+41 -1
public/og-card.png

This is a binary file and will not be displayed.

public/og.png

This is a binary file and will not be displayed.

+41 -1
test/generate_og_card.py
··· 28 28 return ImageFont.load_default() 29 29 30 30 31 + def wrap_text( 32 + draw: ImageDraw.ImageDraw, 33 + text: str, 34 + font: ImageFont.FreeTypeFont | ImageFont.ImageFont, 35 + max_width: int, 36 + max_lines: int | None = None, 37 + ) -> list[str]: 38 + words = text.split() 39 + if not words: 40 + return [] 41 + 42 + lines: list[str] = [] 43 + current = words[0] 44 + 45 + for word in words[1:]: 46 + trial = f"{current} {word}" 47 + if draw.textlength(trial, font=font) <= max_width: 48 + current = trial 49 + continue 50 + 51 + lines.append(current) 52 + current = word 53 + 54 + lines.append(current) 55 + 56 + if max_lines is None or len(lines) <= max_lines: 57 + return lines 58 + 59 + clamped = lines[:max_lines] 60 + last = clamped[-1] 61 + while last and draw.textlength(f"{last}...", font=font) > max_width: 62 + last = last.rsplit(" ", 1)[0] if " " in last else last[:-1] 63 + clamped[-1] = f"{last}..." if last else "..." 64 + return clamped 65 + 66 + 31 67 def main() -> None: 32 68 out_path = Path(__file__).resolve().parent / "og-card.png" 33 69 ··· 138 174 "Minimal, terminal-native output for profiles, posts, threads, " 139 175 "feeds, links, search, and trending topics." 140 176 ) 141 - draw.text((head_x, head_y + 100), body, fill=text_soft, font=mono_small) 177 + body_lines = wrap_text(draw, body, mono_small, max_width=card_w - 108, max_lines=2) 178 + body_y = head_y + 100 179 + for body_line in body_lines: 180 + draw.text((head_x, body_y), body_line, fill=text_soft, font=mono_small) 181 + body_y += 24 142 182 143 183 # Command block 144 184 block_x = head_x
test/og-card.png

This is a binary file and will not be displayed.