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

  1. 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.
  2. Fetch this draft, in NPF.
  3. 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).
  4. 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:

  1. Responding to the ask.
  2. Fetching the response in NPF.
  3. Creating a completely new post, identical to the response – including the contents of the original ask.
  4. 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.


#The Great Tumblr Apocalypse #Tumblr: a User’s Guide #this probably deserves some warning tag but I am not sure what

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.