Skip to content

Instantly share code, notes, and snippets.

@Hasimir
Created October 9, 2019 21:56
Show Gist options
  • Save Hasimir/977e1cebc6bbadfe358e89943c336ce9 to your computer and use it in GitHub Desktop.
Save Hasimir/977e1cebc6bbadfe358e89943c336ce9 to your computer and use it in GitHub Desktop.
Script to check signatures on UK Intersex equal rights petition
#!/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