Skip to content

Instantly share code, notes, and snippets.

@mheadd
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save mheadd/0a95a34a27c72f85111b to your computer and use it in GitHub Desktop.

Select an option

Save mheadd/0a95a34a27c72f85111b to your computer and use it in GitHub Desktop.
How many resolutions were disapproved by DC council in 2014?
curl -s "https://openlims.herokuapp.com/search?measure_type=2&status=120&start_date=1/1/2014&end_date=12/31/2014" 
{
    "data": [
        {
            "Phase": 3,
            "IntroductionDate": "2014/07/11 00:00:00",
            "ComitteeReferral": "[{\"Id\":195,\"Name\":\"Finance and Revenue\"}]",
            "HasCount": true,
            "Title": "PR20-0988",
            "ShortTitle": "Commission on the Arts and Humanities Lavinia Wohlfarth Confirmation  Resolution of 2014",
            "LegislationCategories": "2;#Resolution",
            "LegislationType": "9;#Proposed Resolution",
            "ID": 32317,
            "LegislationStatus": 120,
            "DeemedOn": "2014/11/08 00:00:00",
            "Deemed": "Approved",
            "IsApproved": false,
            "CouncilPeriod": "20;#20",
            "AttachmentPath": "[{\"Type\":\"Introduction\",\"RelativePath\":\"32317\",\"Name\":\"PR20-0988-Introduction.pdf\"}]",
            "ActNumber": "R20-0672",
            "Modified": "2014/11/21 15:21:44"
        },
        {
            "Phase": 3,
            "IntroductionDate": "2014/06/25 00:00:00",
            "ComitteeReferral": "[{\"Id\":195,\"Name\":\"Finance and Revenue\"}]",
            "HasCount": true,
            "Title": "PR20-0925",
            "ShortTitle": "Commission on the Arts and Humanities Judith F. Terra Confirmation Resolution of 2014",
            "LegislationCategories": "2;#Resolution",
            "LegislationType": "9;#Proposed Resolution",
            "ID": 32160,
            "LegislationStatus": 120,
            "DeemedOn": "2014/10/31 00:00:00",
            "Deemed": "Approved",
            "IsApproved": false,
            "CouncilPeriod": "20;#20",
            "AttachmentPath": "[{\"Type\":\"Introduction\",\"RelativePath\":\"32160\",\"Name\":\"PR20-0925-Introduction.pdf\"}]",
            "ActNumber": "R20-0670",
            "Modified": "2014/11/21 15:17:31"
        }
    ],
    "OCR": []
}

Or we can answer the question more directly like...

curl -s "https://openlims.herokuapp.com/search?measure_type=2&status=120&start_date=1/1/2014&end_date=12/31/2014" \
| jq .data[].ShortTitle \
| wc -l

2

@mheadd

mheadd commented Jan 10, 2015

Copy link
Copy Markdown
Author

Example uses the OpenLIMS API. JSON parsing courtesy of jq.

@vdavez

vdavez commented Jan 10, 2015

Copy link
Copy Markdown

jq looks awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment