There are polls on 𝐭𝐮𝐦𝐛𝐥𝐫 dot com
Quite a few people have been asking how I have been making these polls. To make them I have been using the Tumblr API. While it is currently undocumented – there is a polls API route that allows you to post and get poll data. While the Tumblr UI puts quite a few restrictions on how many polls can be in a single post and when polls finish, the API currently has no restrictions on this*.
Poll Behaviour
Each poll and poll answer has a uuid tag (a "client_id") that should, ideally, uniquely identify each poll and poll answer. Silly things start to happen when you make a post with two polls with the same client_id, or one poll with several answers with the same client_id. This is how I made this monstrosity.
Polls also have an "expire_after" tag that allows you to set the deadline for the poll. While the UI restricts this to one day or one week, you can put in any time you like for this. This is how I made the 50-year horsie poll and whatever this is.
There are other fun things like being able to put newlines in polls which only display on mobile for some reason.
Can you make polls like this too?
Yes. In fact, from the beginning, I have had a python package that handles posting polls in a public GitHub repository. All you would need to do is register an app on the Tumblr API to get the various necessary authentication tokens and go ham**. Just be warned, I don't intend for this to be a fully-fledged implementation of the Tumblr API, but it gets the job done and will be useful for a few other projects I'm working on. I don't know when they are planning on adding polls to the API docs, or the official Tumblr clients – but I presume that by the time they do, these zany polls will sadly be no more. It seems like the polls API is still being worked on and I can imagine a lot of these issues (I call them features) being fixed. So let's have fun with it while it lasts.
Making your own fun poll
Let's try to recreate this post using my tumblr-dot-com package. Following the example on the readme to set up a tumblr object for your blog with the necessary auth tokens, the post can be constructed as:
# ... snip
content = (
Content()
.poll(
"Wie cool ist das bitte?",
[
"Jetzt zocke ich Fortnite",
"und trinke Cola",
"YIPPEE!"
],
option_uuids=[uuid4()] * 3
)
)
res = tumblr.post(
content=content,
tags=["Yippee!!", "polls"],
)
# ... snip
Here, the post content is being constructed with a single poll block – the option_uuids is an optional list parameter that allows you to pass custom uuids for the poll options. Here, the option_uuids is being set to the same uuid repeated three times – which causes votes to be counted for all three options at once.
I hope you enjoy this fun little tumblr client – again, it doesn't implement everything from the tumblr API but should be good enough a least to have a play around. Just a final note – since the polls API is not yet final, I am expecting some of the poll-specific behaviour of this client to break at some point – so be warned.
Notes:
* Beyond the other API post restrictions. And, this is probably going to be patched (see this comment).
** This may make your Tumblr account look suspiciously like one of the pretty lady spam bot accounts causing your account to get blasted like mine did.