a guide for querying BBJ on tilde.town
2023-08-07
Yes hi this is a very short note on how to query BBJ on tilde.town.
My use case is that there is a very long BBJ thread that I wanted to export, clean up, store locally, and refer to later.
The API docs are here:
https://github.com/bbj-dev/bbj/blob/master/docs/docs/api_overview.md
and it might be useful to know the error codes as well:
https://github.com/bbj-dev/bbj/blob/master/docs/docs/errors.md
First, you need to call thread_index
to find the id of the thread you’re looking for:
curl 127.0.0.1:7099/api/thread_index
That should give you a big JSON blob that you can jq or search in or whatever. What I did was just open it up in vim and search for the thread title.
Once you have your thread id, you can get the thread contents:
curl -X POST \
-H "Content-Type: application/json" \
-d '{"thread_id:"your-thread-id-here"}' \
127.0.0.1:7099/api/thread_load
And there you have it, a big blob of JSON with the thread contents. Do with it as your little heart desires.