johnHackworth / goblin

GNU Affero General Public License v3.0
50 stars 4 forks source link

Polls enablement/backport? #27

Open krc opened 11 months ago

krc commented 11 months ago

Looks like Firefish has polls, did they implement them after Goblin was forked, or is it like an option to turn on in server config?

Looks like they allow more than the 4 options that Mastodon does, and allow voting for multiple option (if you enable it at poll creation time).

sirilyan commented 8 months ago

Note: Tumblr cross-combat isn't possible - the public API doesn't permit voting in polls or getting results.

johnHackworth commented 7 months ago

yup, this is on my radar since time ago, but they would be 100% independent polls than the ones from tumblr I'm afraid

sirilyan commented 7 months ago

So the RSS for a Tumblr post that contains a poll does have a div with a data-npf attribute, and that attribute contains the poll object:

{
  "type": "poll",
  "client_id": "3f149487-7424-42eb-81c8-c2ec352704ee",
  "question": "no nuance. what do you have",
  "answers": [
    {
      "client_id": "9980ddd7-7a50-49fb-91e0-ed229a0e4c22",
      "answer_text": "small boobs"
    },
    {
      "client_id": "61ec4418-96ed-4ddf-afb2-cef46302e1fc",
      "answer_text": "big boobs"
    }
  ],
  "settings": {
    "multiple_choice": false,
    "close_status": "closed-after",
    "expire_after": 604800,
    "source": "tumblr"
  }
}

(I love how every single time I find an example of anything it's something very, very Tumblr.)

So although it's impossible to use the API, it might be possible to make Tumblr poll posts look nicer and offer a link to Tumblr if you want to vote. The markup could look something like this:

<p>Blah blah poll title</p>
<ul>
  <li>Option 1</li>
  <li>Option 2</li>
</ul>
<p>
  <i>Note: You cannot vote on Tumblr polls from goblin.</i>
  <a href="#">Go to the original post.</a>
</p>