Skip to content

Instantly share code, notes, and snippets.

@elben
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elben/f46f7b935fa0dd7039b1 to your computer and use it in GitHub Desktop.
Save elben/f46f7b935fa0dd7039b1 to your computer and use it in GitHub Desktop.
Polls API for NFL

Documentation that covers the Polls API with constrained topics. The example poll below is powered a stream's constrained topics, and all keyword management will be through the streams UI.

How to create a poll powered by constrained topics (in development):

Poll API

GET http://api.massrelevance.com/v2/polls/(:id).json
GET http://api.massrelevance.com/v2/polls/(:user_name)/(:poll_name).json
Parameter Description
sort Either asc or desc. Defaults to desc.

Real example: http://api.massrelevance.com/v2/polls/3.json

{
  id: "33",
  name: "pro-bowl-1",
  text: "Pro Bowl poll powered by stream constrained topics.",
  counts: {
    total: 74
  },
  id: "1",
  data: [{
    text: "nfc",
    counts: {
      total: 44,
      percent: 59
    },
    data: [{
      title: "nfc",
      type: "constrained_topic",
      counts: {
        total: 44,
        percent: 100
      },
      value: ["nfc", "cardinals", "packers"],
      meta: {}
    }],
    meta: {}
  }, {
    text: "afc",
    counts: {
      total: 30,
      percent: 41
    },
    data: [{
      title: "afc",
      type: "constrained_topic",
      counts: {
        total: 30,
        percent: 100
      },
      value: ["afc", "patriots", "broncos"],
      meta: {}
    }],
    meta: {}
  }]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment