Created
October 9, 2019 21:56
-
-
Save Hasimir/977e1cebc6bbadfe358e89943c336ce9 to your computer and use it in GitHub Desktop.
Script to check signatures on UK Intersex equal rights petition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import requests | |
url = "https://petition.parliament.uk/petitions/276273.json" | |
sigs = [] | |
r = requests.get(url) | |
data = r.json()['data']['attributes']['signatures_by_constituency'] | |
for i in range(len(data)): | |
sigs.append(data[i]['signature_count']) | |
sigsum = sum(sigs) | |
print(""" | |
There are {0} signatures on the petition. | |
""".format(sigsum)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment