5 KiB
kensho
A specialized Mastodon client for extract posts and threads based on date. I use my single user Mastodon server to share rough thoughts. Often I want to pull those posts into an editor for other purposes, like backing up thoughts to my journal or using them as part of an essay or podcast draft.
Why
I use tools like Pocket and Tiny Tiny RSS as part of how I process information from the Internet. I have long established, effective habits around finding, saving, and reading. I continue to struggle with writing and sharing. I realized that the single user instance that I use could help.
I prefer long form writing with a keyboard limiting where and how I can capture incomplete thoughts. Inspired by Cory Doctorow's thoughts on how he uses his blog as a common book, I realized mine is actually my micro-blog. I share most of my interesting insights and experiences first there then use those notes when I am working on an essay or podcast episode.
I have been thinking of my writing process similar to the concept of kensho, a particular form of enlightenment characterized by a flash of insight followed by practice to engage with and fully understand it. This tool, kensho, is meant to support that approach by providing some specific ways for me to query, filter, and format posts from my instance.
How
$ cargo install --path .
$ kensho -u https://thecommandline.social -a <access token> 2023-07-15
See --help
for full details but this incantation connects to my instance and pulls posts from my local timeline, written by mean, from the 15th. I often reply to myself to keep related thoughts together. kensho will pull all replies for those posts, filtering to ones written by me as well. The resulting formatting looks like this.
09:27
> Good morning and TZAG, friends.
>
> I started <a href="https://thecommandline.social/tags/today" class="mention hashtag" rel="tag">#<span>today</span></a> with work on a personal project already. Part of what I have been struggling with is finding the motivation for my own pursuits. Having energy today is a good sign and I hope that by practicing, I am making it easier to spend more time on my own projects in general.
>
> 22:09
>> I took a few breaks from coding for fun to do a bit more work in the yard. I decided to work on the dead spots the boy dogs are causing. I raked out the dead grass and put down rye grass seed. We are due a couple more days of rain. I may have to seed again in the Fall but don't mind watering now and/or using more seed later. Its lighter work compared to mowing.
09:30
> I got sarlacc, my data ingest tool I am writing for $dayjob in <a href="https://thecommandline.social/tags/rust" class="mention hashtag" rel="tag">#<span>rust</span></a>, into a good state. The support for one data provider is completely done, I just started testing in staging towards the end of the day yesterday. I am happy with the technical design, implementation, and documentation. I want my teammates to be able to help. This will be their first intro to Rust. Thankfully I have taught teams enough Rust before to help my current one learn. <a href="https://thecommandline.social/tags/RustLang" class="mention hashtag" rel="tag">#<span>RustLang</span></a>
09:36
> My project this morning is a specialized Mastodon client I started building in <a href="https://thecommandline.social/tags/rust" class="mention hashtag" rel="tag">#<span>rust</span></a> using the megalodon crate. I am trying to automate extracting my posts and threads to format for other uses. I have automatic deletion set up and have been experimenting with saving to my journal. Some threads may end up in a draft essay or link dump, instead. I am happy with my progress so far: successfully pulling all posts by me from my local timeline for a given date.
>
> 22:06
>> I worked on this tool on and off today. I got most of what I had in my head out and working. How it works is pretty specific to my personal processes however if you are curious and want to follow along, the code is here: [https://git.cmdln.net/cmdln/kensho](https://git.cmdln.net/cmdln/kensho)
>>
>> I have a little more formatting work I want to do, for posts like these with multiple paragraphs. I want to be able to filter only or out hashtags.
New threads are block quoted after the timestamp and replies flattened and nested one level. The code uses the html2md
crate to convert the status contents into markdown. The specific formatting is the one I use in my own journal. I use the timestamps so I can add my own notes for thoughts I didn't share. I use block quoting to make clear what comes from my instance versus what are my private thoughts.
To Do
- A sub-command to register and generate an access token
- Add paging support for replies - the context call also supports
max_id
similar to the call to get statuses - Add support to exclude tags - useful for dropping live events
- Add support to filter to specific tags - useful for tagged threads
- Add essay or note format option