forked from stanfordjournalism/search-script-scrape
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path99.py
More file actions
11 lines (11 loc) · 705 Bytes
/
Copy path99.py
File metadata and controls
11 lines (11 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
# According to the Medill National Security Zone, the number of chambered guns confiscated at airports by the TSA in 2014
# http://nationalsecurityzone.org
import csv
import requests
gdoc_url = 'https://docs.google.com/spreadsheets/d/1a65n2HIcBYG7VyZYfVnBXGDmEdR8NYSOF43dzkDIuwA/'
txt = requests.get(gdoc_url + 'export', params = {'format': 'csv', 'gid': 0}).text
# skip the first two lines, which are:
# Mandatory credit, with link: TSA data compiled by Medill National Security Journalism Initiative.
# Data is preliminary and extracted from the TSA Blog. TSA'S year-end totals may very slightly.
rows = list(csv.DictReader(txt.splitlines()[2:]))
print(len([r for r in rows if r['CHAMBERED?'] == 'Y']))