openva / rs-api

Richmond Sunlight's API.
MIT License
1 stars 0 forks source link

Create an API endpoint for votes #10

Open waldoj opened 6 years ago

waldoj commented 6 years ago

Per https://twitter.com/mjgoldsmith/status/963598295661776896

waldoj commented 6 years ago

vote.php is getting vote data via the Vote class, which is...not existing?

I'm confused.

waldoj commented 6 years ago

Here's what it's returning right now for e.g. https://api.richmondsunlight.com/1.1/vote/2018/h09v0069.json:


 {
  "chamber": "house",
  "outcome": "pass",
  "tally": "18-4",
  "legislators": [
    {
      "name": "Bagby, Lamont",
      "shortname": "lbagby",
      "vote": "Y",
      "party": "D",
      "chamber": "house",
      "address": "P. O. Box 406, Richmond, VA 23218",
      "started": "2016",
      "district": "74"
    },
    {
      "name": "Bell, Dickie",
      "shortname": "rpbell",
      "vote": "Y",
      "party": "R",
      "chamber": "house",
      "address": "2620 Eston Drive Staunton, VA 24401",
      "started": "2010",
      "district": "20"
    },
    {
      "name": "Bourne, Jeff",
      "shortname": "jmbourne",
      "vote": "Y",
      "party": "D",
      "chamber": "house",
      "address": null,
      "started": "2017",
      "district": "71"
    },
    {
      "name": "Boysko, Jennifer",
      "shortname": "jbboysko",
      "vote": "Y",
      "party": "D",
      "chamber": "house",
      "address": "730 Elden Street, Herndon, VA 20170",
      "started": "2016",
      "district": "86"
    },
    {
      "name": "Bulova, David",
      "shortname": "dlbulova",
      "vote": "Y",
      "party": "D",
      "chamber": "house",
      "address": "P. O. Box 106, Fairfax, VA 22039",
      "started": "2006",
      "district": "37"
    },
    {
      "name": "Cole, Mark",
      "shortname": "mlcole",
      "vote": "Y",
      "party": "R",
      "chamber": "house",
      "address": "P.O. Box 6046, Fredericksburg, VA 22403",
      "started": "2002",
      "district": "88"
    },
    {
      "name": "Collins, Chris",
      "shortname": "cecollins",
      "vote": "Y",
      "party": "R",
      "chamber": "house",
      "address": "117 W. Boscawen Street, Winchester, VA 22601",
      "started": "2016",
      "district": "29"
    },
    {
      "name": "Helsel, Gordon",
      "shortname": "gchelsel",
      "vote": "Y",
      "party": "R",
      "chamber": "house",
      "address": "P. O. Box 2571, Poquoson VA 23662",
      "started": "2011",
      "district": "91"
    },
    {
      "name": "Keam, Mark",
      "shortname": "mlkeam",
      "vote": "Y",
      "party": "D",
      "chamber": "house",
      "address": "P.O. Box 1134, Vienna, VA 22183-1134",
      "started": "2010",
      "district": "35"
    },
    {
      "name": "Landes, Steve",
      "shortname": "rslandes",
      "vote": "Y",
      "party": "R",
      "chamber": "house",
      "address": "P.O. Box 12, Verona, VA 24482",
      "started": "1996",
      "district": "25"
    },
    {
      "name": "LaRock, Dave",
      "shortname": "dalarock",
      "vote": "Y",
      "party": "R",
      "chamber": "house",
      "address": "P.O Box 6\r\nLoudoun, VA 20159",
      "started": "2014",
      "district": "33"
    },
    {
      "name": "Leftwich, Jay",
      "shortname": "jaleftwich",
      "vote": "Y",
      "party": "R",
      "chamber": "house",
      "address": null,
      "started": "2014",
      "district": "78"
    },
    {
      "name": "McGuire, John J.",
      "shortname": "jjmcguire",
      "vote": "Y",
      "party": "R",
      "chamber": "house",
      "address": "11357 Nuckols Road, #156\r\nGlen Allen, VA 23059",
      "started": "2018",
      "district": "56"
    },
    {
      "name": "Pogge, Brenda",
      "shortname": "blpogge",
      "vote": "Y",
      "party": "R",
      "chamber": "house",
      "address": "8412 Down Patrick Highway, Williamsburg, VA 23188",
      "started": "2008",
      "district": "96"
    },
    {
      "name": "Robinson, Roxann",
      "shortname": "rlrobinson",
      "vote": "Y",
      "party": "R",
      "chamber": "house",
      "address": "9409 Hull Street Road, Suite F-1 Rockwood Office Park, Richmond VA 23236",
      "started": "2010",
      "district": "27"
    },
    {
      "name": "Rodman, Debra",
      "shortname": "dhrodman",
      "vote": "Y",
      "party": "D",
      "chamber": "house",
      "address": "6744 Wilber Circle\r\nHenrico, VA 23228",
      "started": "2018",
      "district": "73"
    },
    {
      "name": "VanValkenburg, Schuyler",
      "shortname": "stvanvalkenburg",
      "vote": "Y",
      "party": "D",
      "chamber": "house",
      "address": null,
      "started": "2018",
      "district": "72"
    },
    {
      "name": "Yancey, David",
      "shortname": "deyancey",
      "vote": "Y",
      "party": "R",
      "chamber": "house",
      "address": "P.O. Box 1163, Newport News, VA 23601",
      "started": "2012",
      "district": "94"
    },
    {
      "name": "Davis, Glenn",
      "shortname": "grdavis",
      "vote": "N",
      "party": "R",
      "chamber": "house",
      "address": null,
      "started": "2014",
      "district": "84"
    },
    {
      "name": "Hurst, Chris",
      "shortname": "clhurst",
      "vote": "N",
      "party": "D",
      "chamber": "house",
      "address": "P.O. Box 11389 \r\nBlacksburg, Virginia 24062",
      "started": "2018",
      "district": "12"
    },
    {
      "name": "Turpin, Cheryl",
      "shortname": "cbturpin",
      "vote": "N",
      "party": "D",
      "chamber": "house",
      "address": "\"4540 Princess Anne Road\r\nSuite #114\r\nVirginia Beach, VA 23462\"",
      "started": "2018",
      "district": "85"
    },
    {
      "name": "Tyler, Roslyn",
      "shortname": "rctyler",
      "vote": "N",
      "party": "D",
      "chamber": "house",
      "address": "25359 Blue Star Highway, Jarratt, VA 23867",
      "started": "2006",
      "district": "75"
    }
  ]
}

It remains to add some basic data about both the vote and the bill. Presumably the date of the vote, where the vote was held (e.g., in a committee or a subcommittee), the HTML URL, and basic data about the bill like the number, catchline, and endpoint URL.