Poll - danopia/deviantart-difi GitHub Wiki

user_poll_vote

Votes in a user poll and returns results.

Usage

  • Called when the user interacts with a running poll.
    e.g.: https://www.deviantart.com/<username>/journal/poll/<pollid>/

Params

  • answerid: number (e.g. "23499178")
  • pollid: number (e.g. "5770761")
  • poll_ownerid: number, the user id of the creator (e.g. "13461179")

Response

Returns an object which contains a Dialog-like "html" entry (which is used to replace the poll voting UI).

If you like, you should be able to scrape the running tally from the HTML.

{"html":"<div  name=\"gmi-GUserPoll\" id=\"gmi-GUserPoll\" data-gmiclass=\"GUserPoll\" gmi-id=\"5770761\" gmi-gruser_id=\"13461179\" gmi-voted=\"1\"> . . . <\/div>"}

site_poll_vote

Votes on the "Today" page.

Usage

  • When voting on a site-wide poll (i.e. https://poll.deviantart.com/)
  • Called when voting on a site poll from the Message Center
  • The polls used to appear in the website footer

Params

  • pollid: number, e.g. 446
  • answerid: number, e.g. 2499
  • ???: string (e.g. "mc" for Message Center or "today" for the Today page)

The third parameter seem to indicate the origin source of the vote.

Response

Returns an object which contains a Dialog-like "html" entry (which is used to display or replace the poll voting UI).

If you like, you should be able to scrape the running tally from the HTML.

{"html":"<div  name=\"gmi-GUserPoll\" id=\"gmi-GUserPoll\" data-gmiclass=\"GUserPoll\" gmi-id=\"446\" gmi-gruser_id=\"sitepoll\" gmi-voted=\"1\"> . . . <\/div>"}
⚠️ **GitHub.com Fallback** ⚠️