Dex

Big hearted fluffdragon...

...fictional ex-90s platformer mascot, nerd, plural, ΘΔ.


posts from @Dex tagged #json

also:

so, one of the discussions in VR this morning turned to how we structure the folder of commissions we've got. the key component in ours hasn't really changed since 2017/2018, but something may have to at some point.

OneDrive/Pictures/Furry/My Commissions/

One subfolder per artist. Acts as source of truth for everything including artist provided; WIPs and full resolution images all go here. Stuff preferably keeps the artist provided filename, even if it means creating a subfolder from them naming multiple things dex.png

iCloud Photo Library

I want to have everything ready to go on phone as well (also those dark few years of using an iPad as main machine). Artist folder with one album per artist, also a separate folder. This only stores webres images so we can't make a mistake on phone.

OneDrive/git/dexthedragon.co.uk/_data/dex.json

This acts the source of truth about metadata, alt text, tags, other people involved, and the like, resizing all images within the main OneDrive folder, with a list of exceptions for images not to touch. Used to build the website, based on MD5 hash - built for speed, not security (no idea what happens if there's ever a hash collision). Built on a collection of scripts that get the MD5, save a resized copy to 1200x1200 max, as well as handling other format conversions and thumbnail generations.

Problems

This setup mostly works, but it does run into the issue that we're slowly trying to move away from OneDrive for other things as we've moved away from Windows. For the moment, this still works, but if we do ever fix up the desktop Linux machine, the only way that can programatically access OneDrive is (as far as I know) Samba to the NAS, which isn't the fastest. Still, I think the NAS would be fine for this, there are some other uses where it might be more of a problem.

Additionally, I've wondered about switching the source of truth on metadata to Obsidian, for easier access to info without going through 8000 lines of JSON - for doing things like linking the source concept for that commission or bits of data that might be useful to me but don't need to be on the website (e.g. outfit here was inspired by this past commission) - but I feel like the things that would make it useful for person readable metadata would make it more awkward for scripting the website; I do not particularly feel like writing a bunch of regexes to get data back out of Markdown. And having them as two separate sources of truth risks them getting out of sync.

There's also an argument to be made for putting the alt text in iCloud as well as a caption, given that our Masto app of choice will now auto fill in alt text based on caption

curious how other people handle it

this is overkill for the vast majority of people, but it also makes it very difficult to lose something permanently given the amount of redundancy and backups

so curious what everyone else does



i wish cohost had an easy way of searching your own posts

i often end up either journalling in public, or wanting to reblog something i've already posted because the mood strikes, or because I don't know if I've already posted something
and i feel like if i either haven't tagged it properly or captured the link elsewhere, it's Just Gone

on twitter, this was very easy with the advanced search. i have a text replacement shortcut setup (qqdex) that expands to from:dexthedragon 1, just enter in a keyword or date range after that, and go.
this is less reliable since locking my account over there (and it never worked with 💜's always 🔒 account), but we've also got archives we can use; same goes if there's anything from the tumblr era

mastodon is a bit more of a pain (by design), but mastodon-archive allows me to get a JSON file of all my toots, and from there i can either use the included text search or parse the JSON by myself
not ideal, not the most friendly, but it works for me

presumably this is one of those things that will happen when the cohost API is available officially, maybe it's doable with the unofficial APIs now, but eh, I'll wait


  1. as an aside, these are really handy for links or things that you use frequently, i've got another one for immediately getting to my ref sheet



today I learned about jc, a terminal utility that solves a pretty big problem for me, so sharing this in the knowledge it might help someone else

jc parses output from terminal programs and returns it as structured JSON objects, making it significantly easier to pass the important data through to other commands or reformat it in any way you wish

this is particularly good for me; a primarily windows sysadmin that now uses windows as little as possible in their personal life other than VR, the scripting language I'm most used to is still PowerShell 1 - which also works with structured objects rather than plain text (and also has very robust support for working with json)
it's sometimes painful to drop down to native commands because either they don't have a JSON output option, or I need to look it up every time, and I don't want to have to parse plain text all the time either.


  1. I know I should learn some Python or bash scripting at some point for work Linux machines that don't have PS installed, practice with them personally before needing to use them at work - but a lot of times the thing i want to do on personal machines is a quick bodge, and at this point i'm pretty familiar with using PS as duct tape