+8
-8
posts/This post was published from a git repository and here's how I did it.md
+8
-8
posts/This post was published from a git repository and here's how I did it.md
···
31
31
[goat](https://github.com/bluesky-social/goat) is a CLI tool for interacting with AT Protocol. Using goat, we can do everything we will need for this project: listing records for an account, querying records from a specific collection, as well as querying, updating, or deleting specific records.
32
32
33
33
34
-
Running it as part of CI is also really straightforward, I was pleasantly surprised to find out. It was a lot easier than I expected to get goat to authenticate with my PDS and [make a post on BSky](https://bsky.app/profile/m1emi1em.dev/post/3lwenaigagl2b) when I did a [test push to main on a repo](https://tangled.sh/@m1emi1em.dev/test-repo-please-ignore/pipelines/760/workflow/build.yml).
34
+
Running it as part of CI is also really straightforward, I was pleasantly surprised to find out. It was a lot easier than I expected to get goat to authenticate with my PDS and [make a post on bsky](https://bsky.app/profile/m1emi1em.dev/post/3lwenaigagl2b) when I did a [test push to main on a repo](https://tangled.sh/@m1emi1em.dev/test-repo-please-ignore/pipelines/760/workflow/build.yml).
35
35
36
36
37
-
Making a record for a blog post on WhiteWind with goat is slightly more involved than a BSky post. But it's just a matter of making a JSON file and feeding that to goat so it's still very easy.
37
+
Making a record for a blog post on WhiteWind with goat is slightly more involved than a bsky post. But it's just a matter of making a JSON file and feeding that to goat so it's still very easy.
38
38
39
39
40
40
# Defining _exactly_ what I want to do
···
52
52
# rkeys
53
53
54
54
55
-
Record keys, or rkeys, are used to reference a specific record in a collection in a repository on a PDS. They are most commonly TIDs generated at the time the record was created - this is what BSky uses for most (all?) of their records.
55
+
Record keys, or rkeys, are used to reference a specific record in a collection in a repository on a PDS. They are most commonly TIDs generated at the time the record was created - this is what bsky uses for (almost) all of their records.
56
56
57
57
58
58
My idea for tracking which records correspond to which files in the git repo was: write my own records in my own, separate collection on my PDS that contained the local file path to a source `.md` file using the same rkey as the WhiteWind blog record created from that file. An example of one of these records be viewed through PDSls [here](https://pdsls.dev/at://did:plc:4ijrxutxndrcbmwd2bzchsum/dev.m1emi1em.blog.postRef/3lwjxlkcurs4i).
···
61
61
WhiteWind, at least at the time of writing, doesn't do any validation when getting stuff from a user's PDS that a record has a valid TID as an rkey like [their lexicon would imply](https://github.com/whtwnd/whitewind-blog/blob/main/lexicons/com/whtwnd/blog/entry.json#L8). So it's totally possible to just create a post with anything that's a valid rkey, but that seems sketchy to rely on and would break if WhiteWind ever actually validated that. Which meant that, if I didn't want to rely on behavior that shouldn't even work in the first place, I had to figure out TIDs.
62
62
63
63
64
-
Fortunately TIDs are relatively straightforward, and even more thankfully when I was posting occasionally on BSky throughout the process of writing a script to do all of this, @zed.earth pointed me in the direction of [his own TID library for Clojure](https://github.com/BlushSocial/atproto-tid) which wasn't too difficult to adapt into what I ended up writing to glue all of this together.
64
+
Fortunately TIDs are relatively straightforward, and even more thankfully when I was posting occasionally on bsky throughout the process of writing a script to do all of this, [@zed.earth](https://bsky.app/profile/zed.earth) pointed me in the direction of [his own TID library for Clojure](https://github.com/BlushSocial/atproto-tid) which wasn't too difficult to adapt into what I ended up writing to glue all of this together.
65
65
66
66
67
67
# Clojure?
···
92
92
93
93
94
94
I'd also like to refactor and rewrite my script at some point to make it easy for others to use to also publish to WhiteWind from a git repo if they wanted to. There's also a few other things I'm interested in figuring out and adding to it as well:
95
-
- Sharing a new post on BSky on post creation. This is super doable.
95
+
- Sharing a new post on bsky on post creation. This is super doable.
96
96
- Figuring out a better way to handle post titles and post visibility. Right now the script just makes a post title by trimming the `.md` from the end of the filename and is also hardcoded to create the record with a public visibility. Something like Obsidian-style YAML frontmatter to specify a post title and visibility seems like a good solution? But I haven't thought too hard on how to best do this.
97
97
- WhiteWind supports embedding images into posts via blobs on a post's record. What I have right now does not account for this or do anything to allow it. It would be nice to have this.
98
98
···
105
105
106
106
107
107
Thanks to all the people who helped me throughout the course of doing all this:
108
-
- @nelind.dk helped me a ton with figuring out CI basics, any atproto questions I had, and also helped me sort out running into a bug with tangled's secret handling
109
-
- @oppi.li and @icyphox.sh for tangled, as well as also getting a fix for secret handling on tangled's end figured out and made live as quickly as they did
110
-
- @zed.earth for pointing me to their Clojure lib for TID handling [BlushSocial/atproto-tid](https://github.com/BlushSocial/atproto-tid)
108
+
- [@nel.pet](https://bsky.app/profile/nel.pet) helped me a ton with figuring out CI basics, any atproto questions I had, and also helped me sort out running into a bug with tangled's secret handling
109
+
- [@oppi.li](https://bsky.app/profile/oppi.li) and [@icyphox.sh](https://bsky.app/profile/icyphox.sh) for tangled, as well as also getting a fix for secret handling on tangled's end figured out and made live as quickly as they did
110
+
- [@zed.earth](https://bsky.app/profile/zed.earth) for pointing me to their Clojure lib for TID handling [BlushSocial/atproto-tid](https://github.com/BlushSocial/atproto-tid)