Created
November 10, 2025 15:53
-
-
Save cmj/7533621d4e0b1f47135169143be7d2b9 to your computer and use it in GitHub Desktop.
Create Bluesky post screenshot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Grab a bluesky post screenshot | |
| # ex: https://bsky.app/profile/gamingonlinux.com/post/3m5bsgkarya23?ref_src=embed | |
| input=$1 | |
| usage() { echo "$0 <bluesky_url>"; exit 1; }; [ -z "$input" ] && usage | |
| handle=$(cut -d/ -f5 <<< "${input}") | |
| post=${input##*/} | |
| did_url="https://bsky.social/xrpc/com.atproto.identity.resolveHandle" | |
| did=$(curl -s -G \ | |
| -d "handle=$handle" \ | |
| "$did_url" | jq -r .did) | |
| file="${handle}-${post%%\?*}-$(date +%Y-%m-%d_%H%M%S).png" | |
| shot-scraper "https://embed.bsky.app/embed/${did}/app.bsky.feed.post/${post%%\?*}?colorMode=dark" \ | |
| -p -4 \ | |
| --retina \ | |
| --wait 2000 \ | |
| -s '.max-w-full.pb-2\.5.pt-3.px-4.flex-1' \ | |
| -o "$file" 2>&1 | sed 's/.* written /Screenshot written /' | |
| # upload to imgur | |
| #imgur "$file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment