Skip to content

Commit 082c2ec

Browse files
author
saschwafel
committed
Troubleshooting geolocation
1 parent 4257e2f commit 082c2ec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Students/SSchwafel/Project/InformedVoter.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,17 @@
3333

3434
legislators = json.load(urllib2.urlopen('https://congress.api.sunlightfoundation.com/legislators/locate?latitude={}&longitude={}&apikey=15f4679bdc124cd6a2c6be8666253000'.format(user_lat, user_long)))
3535

36+
for i in legislators['results']:
37+
print i['last_name'] + ' ' + i['bioguide_id']
3638

3739
#All Legislators, irrespective of location
3840

3941
#House only
4042
#legislators = json.load(urllib2.urlopen('https://congress.api.sunlightfoundation.com/legislators?chamber=house&per_page=all&apikey=15f4679bdc124cd6a2c6be8666253000'.format(user_lat, user_long)))
4143

4244
#All Legislators
43-
legislators = json.load(urllib2.urlopen('https://congress.api.sunlightfoundation.com/legislators?per_page=all&apikey=15f4679bdc124cd6a2c6be8666253000'.format(user_lat, user_long)))
45+
#legislators = json.load(urllib2.urlopen('https://congress.api.sunlightfoundation.com/legislators?per_page=all&apikey=15f4679bdc124cd6a2c6be8666253000'.format(user_lat, user_long)))
4446

45-
#pprint(legislators['results'])
4647
#print 'Based on the latitude and longitude provided, your United States Congresspeople are: \n'
4748

4849

@@ -75,4 +76,4 @@ def print_legislators():
7576
elif i['chamber'] == 'senate':
7677
print 'Senator {} {} - {} \nPhone: {}\nWebsite: {}\n'.format(i['first_name'],i['last_name'],i['party'],i['phone'],i['website'] )
7778

78-
print_legislators()
79+
#print_legislators()

0 commit comments

Comments
 (0)