A Lexicon For A Cat
About five weeks before our wedding K and I adopted a kitten we named Ffion. He is our pride and joy. He is also the most rambunctious motherfucker on the planet - this is standard for kittens, and especially for ginger kittens, but never having raised a kitten before I am still often shocked by the sheer amount of energy the little guy has.
I have been toying around with some ideas for pet projects and one that seems both fun to me and like a nice little gift for K is a social network based on ATProto that gives us updates on our beautiful idiot son, semi-inspired by dame.is's social network for toilet use, Flushes. This also offers some fun opportunities to play with physical computing by setting up sensors or cameras to automatically update the network when the baby does something. I'm short on time again today so I'm just sketching out a lexicon for cat-related events that might make sense in the context of a social network for cat.
A lexicon is a schema for describing API events and related records that a PDS uses. Right now I'm imagining the format for this would be a status update, potentially accompanied by an image. So I want to set up potential tokens for the status update:
// status tokens
//state tokens
{
"lexicon": 1,
"id": "com.ffion.eating",
"defs": {
"main": {
"type": "token",
"description": "Ffion is eating.",
}
}
}
{
"lexicon": 1,
"id": "com.ffion.zoomies",
"defs": {
"main": {
"type": "token",
"description": "Ffion is being insane.",
}
}
}
{
"lexicon": 1,
"id": "com.ffion.playing",
"defs": {
"main": {
"type": "token",
"description": "Ffion is playing.",
}
}
}
{
"lexicon": 1,
"id": "com.ffion.sleeping",
"defs": {
"main": {
"type": "token",
"description": "Ffion is sleeping.",
}
}
}And then set up a status record representation that can take these tokens (and potentially an image).
// state representation to take tokens
{
"lexicon": 1,
"id": "com.ffion.status",
"defs": {
"main": {
"type": "record",
"record": {
"type": "object",
"required": ["status"],
"properties": {
"state": {
"type": "string",
"knownValues": [
"com.ffion.eating",
"com.ffion.zoomies",
"com.ffion.playing",
"com.ffion.sleeping"
]
}
},
"image": {
"type": "blob"
}
}
}
}
}I used Dan Abramov's resolve-lexicon tool to compare this with some of the official Bluesky lexicons, and though it's significantly dumbed down (e.g. it doesn't take a timestamp or do anything with views yet) I think this is at least a valid first pass at one for Ffion's app. I'll do some actual testing with the official lexicon package and lpm tomorrow.
'Til next time.