AI agent skills related to using social media
2
fork

Configure Feed

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

Switch bluesky_read_timeline output from box-drawing to markdown

Replace box-drawing card format (╔║╚) with plain markdown: h2 headers
per post, inline stats, URI label, horizontal rule separators. Remove
string-map-lines helper and unused requires (racket/list, racket/match,
racket/string).

Signed-off-by: Claude <claude@notjack.space>

Claude 6031ed0d 8c8c5f13

+20 -56
+20 -56
bluesky/read-timeline.rkt
··· 1 1 #lang racket/base 2 2 3 3 4 - (require racket/list 5 - racket/match 6 - racket/string 7 - social-skills/atproto/xrpc) 4 + (require social-skills/atproto/xrpc) 8 5 9 6 10 7 (module+ main ··· 27 24 (if author-display-name 28 25 (format "~a (@~a)" author-display-name author-handle) 29 26 (format "@~a" author-handle))) 30 - (define post-author-line (format "╔══ Post from ~a\n" author-tag)) 27 + (define timestamp (hash-ref post 'indexedAt)) 28 + (printf "## ~a — ~a\n\n" author-tag timestamp) 31 29 (define reason (hash-ref feed-item 'reason #false)) 32 - (define reason-line 30 + (when reason 33 31 (cond 34 - [(not reason) ""] 35 32 [(equal? (hash-ref reason '$type) "app.bsky.feed.defs#reasonRepost") 36 33 (define reposter (hash-ref reason 'by)) 37 34 (define reposter-handle (hash-ref reposter 'handle)) 38 35 (define reposter-display-name (hash-ref reposter 'displayName #false)) 39 36 (if reposter-display-name 40 - (format "║ Reposted by ~a\n" reposter-display-name) 41 - (format "║ Reposted by @~a\n" reposter-handle))] 42 - [(equal? (hash-ref reason '$type) "app.bsky.feed.defs#reasonPin") "║ [Pinned]\n"] 43 - [else ""])) 44 - (define timestamp-line (format "║ ~a\n" (hash-ref post 'indexedAt))) 37 + (printf "Reposted by ~a\n\n" reposter-display-name) 38 + (printf "Reposted by @~a\n\n" reposter-handle))] 39 + [(equal? (hash-ref reason '$type) "app.bsky.feed.defs#reasonPin") 40 + (displayln "[Pinned]\n")] 41 + [else (void)])) 45 42 (define post-text (hash-ref (hash-ref post 'record) 'text)) 46 - (define post-text-block 47 - (if (equal? post-text "") 48 - "" 49 - (string-append (string-map-lines post-text (λ (line) (string-append "║ " line))) "\n"))) 50 - (define embedded-content-line (if (hash-has-key? post 'embed) "║ (embedded content)\n" "")) 43 + (unless (equal? post-text "") 44 + (displayln post-text) 45 + (newline)) 46 + (when (hash-has-key? post 'embed) 47 + (displayln "(embedded content)\n")) 51 48 (define reply-count (hash-ref post 'replyCount)) 52 - (define reply-count-line 53 - (format "║ ~a ~a\n" reply-count (pluralize reply-count "reply" "replies"))) 54 49 (define repost-count (hash-ref post 'repostCount)) 55 - (define repost-count-line 56 - (format "║ ~a ~a\n" repost-count (pluralize repost-count "repost" "reposts"))) 57 50 (define like-count (hash-ref post 'likeCount)) 58 - (define like-count-line (format "║ ~a ~a\n" like-count (pluralize like-count "like" "likes"))) 59 - (define spacing-line "║\n") 60 - (define uri-line (format "║ ~a\n" (hash-ref post 'uri))) 61 - (define ending-line "╚\n") 62 - (display post-author-line) 63 - (display reason-line) 64 - (display timestamp-line) 65 - (display spacing-line) 66 - (display post-text-block) 67 - (display embedded-content-line) 68 - (display spacing-line) 69 - (display reply-count-line) 70 - (display repost-count-line) 71 - (display like-count-line) 72 - (display spacing-line) 73 - (display uri-line) 74 - (display ending-line) 51 + (printf "~a ~a, ~a ~a, ~a ~a\n\n" 52 + reply-count (pluralize reply-count "reply" "replies") 53 + repost-count (pluralize repost-count "repost" "reposts") 54 + like-count (pluralize like-count "like" "likes")) 55 + (printf "URI: ~a\n\n" (hash-ref post 'uri)) 56 + (displayln "---") 75 57 (newline))) 76 58 77 59 78 60 (define (pluralize n singular-form plural-form) 79 61 (if (equal? n 1) singular-form plural-form)) 80 62 81 - 82 - (define (string-map-lines str f 83 - #:first-line [g f] 84 - #:last-line [h f] 85 - #:only-line [k f] 86 - #:no-lines [no-lines ""]) 87 - (define lines (string-split str "\n" #:trim? #false)) 88 - (define updated-lines 89 - (match lines 90 - [(list) (list)] 91 - [(list only) (list (k only))] 92 - [(list first middle ... last) 93 - (append (list (g first)) 94 - (map f middle) 95 - (list (h last)))])) 96 - (if (empty? updated-lines) 97 - no-lines 98 - (string-join updated-lines "\n"))) 99 63 100 64 101 65 (module+ main