Skip to content

Add tweetshot.py, the X composer renderer for the #tweets automation - #28

Open
helloworld wants to merge 1 commit into
mainfrom
sashank/tweet-composer-renderer
Open

Add tweetshot.py, the X composer renderer for the #tweets automation#28
helloworld wants to merge 1 commit into
mainfrom
sashank/tweet-composer-renderer

Conversation

@helloworld

@helloworld helloworld commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Adds tweetshot.py, which renders a line of text as a screenshot of the X (Twitter) composer:

example

python3 tweetshot.py --name sashank --handle sthupukari \
  --avatar "https://unavatar.io/x/sthupukari?fallback=false" \
  --text "message text" --out /tmp/tweet.png

It lives here because the new Tweet mockups automation curls it at run time to reply to every message in #tweets: automation instructions are capped at 8 KB and the script is 12 KB. Until this merges the automation falls back to the raw URL on this branch.

Geometry, type and colours were matched pixel for pixel against the mockup Sashank posted: 642 css px wide at 2x device scale, 40 px avatar, Inter Tight at 16.7 px on a 20 px line, the composer icon strip embedded as a base64 PNG. Fonts come from Google Fonts at render time (Liberation Sans as fallback), emoji from Noto Color Emoji subset to the characters in the message, avatars from unavatar with a generated initial circle as last resort.

View in Indent View in Slack
Tag @indent to continue the conversation here.

The Tweet mockups automation curls this at run time and pipes each Slack
message through it, so it lives here rather than inside the automation's
instructions, which are capped at 8 KB.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant