About my fake staff ask
How I made it:
Currently, the tumblr API just… lets you make a post in which you “reply” to an “ask” from an arbitrary user, containing arbitrary content.
In tumblr’s Neue Post Format (NPF), responses to asks look similar to other posts. The only difference is that they have a special entry in their “layout,” specifying which part of the post is the ask, and who it is from.
Right now, if you try to create an NPF post with this kind of layout entry in it, it just works! You can use this to make an “ask” from anyone, containing anything, and answer it.
This is a huge bug and presumably will get fixed sometime soon?
How I discovered the bug:
Weirdly enough, I find out about it while trying to improve @nostalgebraist-autoresponder’s alt text features this past week.
As you may have noticed, Frank now writes alt text differently, with more clarity about which pieces are AI-generated and what role they play.
While making this change, I found myself newly frustrated with my inability to use line breaks in alt text. The API used to let me do it, but then it stopped, hence all the “[newline]” stuff in older alt texts.
After poking around, I found that you can use line breaks in alt text on tumblr, and you can do this through the API, but only if you create posts in NPF.
Frank creates posts in legacy, not NPF. This has been true forever, and it works fine so I’ve had no reason to change it.
Fully rewriting Frank’s post creation code to use NPF would take a lot of work.
Right now, Frank’s language model generates text very close to a limited subset of HTML, which I can send to tumblr as “legacy” post content basically as-is. To create posts in NPF, I’d have to figure out the right way to convert that limited HTML into NPF’s domain-specific block language.
I wasn’t going to do that just to support this one nicety of alt text formatting.
“But wait…”, I thought.
“Frank is already making these posts, with the alt text, in legacy format. And once they exist on tumblr, it’s easy to determine how to represent them in NPF. I just fetch the existing post, in NPF format.”
So all I need to do is
- Have Frank make the post, as a draft, with the alt text containing “[newline]” or something in place of the line breaks I really want.
- Fetch this draft, in NPF.
- Create a new NPF post, with the same contents that we just fetched, in whichever state we wanted for the original post (draft, published, or queued).
- Delete the draft we made in step 1.
This was convoluted, but it worked! I patted myself on the back for a clever workaround, and went on to do other stuff for a while…
…and then it hit me.
In the case where the post was a response to an ask, Frank was doing the following:
- Responding to the ask.
- Fetching the response in NPF.
- Creating a completely new post, identical to the response – including the contents of the original ask.
- Deleting the original ask.
Meaning, you can just make asks ab nihilo, apparently.
So after a few more tests, I went and made the @staff ask, as one does.
Unfortunately, once the bug gets fixed, Frank’s newlines-in-alt-text solution won’t work for asks anymore… oh well, it wasn’t a big deal anyway.
groundnotsteel reblogged this from iamramonadestroyerofworlds
groundnotsteel liked this
zebmoiguco liked this
iamramonadestroyerofworlds reblogged this from nostalgebraist
iamramonadestroyerofworlds liked this
eathotchip-and-bi liked this tematomo2 liked this
burnt-cd liked this
karakun-ulquibat liked this
serenfire liked this
calamity-triquetra liked this
yumejin liked this rainingmoondrops liked this
somegirlblr reblogged this from reachartwork
zabreus liked this
addiehour liked this
kittenonaplate liked this
shadow-queens-blog liked this most-definitely-human reblogged this from derinthescarletpescatarian
hajikelist reblogged this from nostalgebraist
daughterofluthien liked this ythaenagor liked this
quailgirlpeep liked this
feelslike1959 liked this
thaddeusmike reblogged this from explodingsilver
thaddeusmike liked this explodingsilver reblogged this from cromulentenough
shadolite liked this
kool--kitty reblogged this from nostalgebraist
kool--kitty liked this
wdcasey1895 reblogged this from whetstonefires
nilalienum liked this learn-tilde-ath liked this
partialpeanut liked this
cptn-catastrophic reblogged this from n4ut1lus
marianaser liked this n4ut1lus reblogged this from nostalgebraist
n4ut1lus liked this
marikiathoi reblogged this from this-glittering-world
marikiathoi liked this
miks-fantrolls liked this
kim-poce liked this
maryellencarter liked this randomschtuffrepository reblogged this from brin-bellway
jellomortality liked this
perniciouslizard liked this
brin-bellway reblogged this from nostalgebraist superchlorine liked this
dogspeaker liked this
- Show more notes
