Seblog.nl
Another take on uploading screenshots to a Micropub Media Endpoint
Over the last months I’m on IRC more often. I like the simplicity of sending plain-text messages, but from time to time I like to send a picture as well. The best way to do that on IRC is to upload the file somewhere else and send a link. Uploading files can be a hassle though.
I must admit that this problem is somewhat born because I already found a solution for it elsewhere. I followed Aaron’s recipe for creating a folder that uploads images, but for the times I needed it, I found it tedious to drag my screenshots to that folder. So here’s my alteration of it.
My workflow is nearly the same, but I choose the type ‘Voorziening’ (what’s that in English?), which makes it available in the right-click-menu. I can just select a file, right-click, and go to Voorzieningen > Upload to Media Endpoint
.

I let it accept images, but you can go for documents in general as well, and the rest of the workflow is the same as Aaron’s. (Make sure to pass the input to the shell script as arguments!) The only thing is that it will receive a list of files, so I changed the shell script to:
for f in "$@"
do
curl -i -F "file=@$f" -H "Authorization: Bearer xxx" https://example.com/media-endpoint | grep Location: | sed -En 's/^Location: (.+)/\1/p' | tr -d '\r\n' | pbcopy
done
Note that this uploads multiple files and only saves the last url to the clipboard. I just select one file per upload, so that will be fine.
Voelen jullie die schrikkelseconde ook zo vandaag? Ik denk steeds dat het nog 18:38:24 is...

Gelukkig nieuwjaar allemaal!
Na de bakker, de AH en nogmaals de AH omdat huisgenoot M. haar auto deukte, hebben we alles nu wel. De rest van het jaar blijf ik thuis.
Oké, ik moet nu echt op zoek gaan naar oliebollen, anders worden mijn huisgenoten boos. Waar haal je die dingen nog op dit uur?
Vannacht om 1 uur onze tijd is er een schrikkelseconde. Ik denk dat ik op ga blijven daarvoor.
Ik geloof dat ik net een driepersoonslasagne naar binnen gewerkt heb.

Stoute poes.

De kat moet niets hebben van mijn ludieke kerstmuts. Dus dan alleen namens mij: fijne kerst!
Met de kerstdagen praat ik meer dan ik typ en merk ik dat ik bepaalde dingen niet kan uitdrukken. Wat is de vocale variant van 🎉?