AI agent skills related to using social media
2
fork

Configure Feed

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

Add a basic `bluesky_read_timeline` script

+38 -3
+1 -1
atproto/xrpc.rkt
··· 7 7 (provide 8 8 (contract-out 9 9 [agent-xrpc-get 10 - (->* (string?) ((hash/c symbol? string?) #:service (or/c string? #false)) jsexpr?)])) 10 + (->* (string?) ((hash/c symbol? any/c) #:service (or/c string? #false)) jsexpr?)])) 11 11 12 12 13 13 (require json
+4 -2
bluesky/info.rkt
··· 2 2 3 3 4 4 (define racket-launcher-names 5 - (list "bluesky_open")) 5 + (list "bluesky_open" 6 + "bluesky_read_timeline")) 6 7 7 8 8 9 (define racket-launcher-libraries 9 - (list "open-app.rkt")) 10 + (list "open-app.rkt" 11 + "read-timeline.rkt"))
+33
bluesky/read-timeline.rkt
··· 1 + #lang racket/base 2 + 3 + 4 + (require social-skills/atproto/xrpc) 5 + 6 + 7 + (module+ main 8 + (require (submod "..") 9 + racket/cmdline)) 10 + 11 + 12 + ;@---------------------------------------------------------------------------------------------------- 13 + 14 + 15 + (define (read-timeline) 16 + (define timeline (agent-xrpc-get "app.bsky.feed.getTimeline" (hash 'limit 10))) 17 + (define feed (hash-ref timeline 'feed)) 18 + (for ([feed-item (in-list feed)]) 19 + (define post (hash-ref feed-item 'post)) 20 + (define author (hash-ref post 'author)) 21 + (define author-display-name (hash-ref author 'displayName #false)) 22 + (define author-handle (hash-ref author 'handle)) 23 + (define author-tag 24 + (if author-display-name 25 + (format "~a (@~a)" author-display-name author-handle) 26 + (format "@~a" author-handle))) 27 + (printf "~a\n\n ~a\n\n\n" author-tag (hash-ref (hash-ref post 'record) 'text)))) 28 + 29 + 30 + (module+ main 31 + (command-line 32 + #:args () 33 + (read-timeline)))