Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Apr 11, 2012
Eric Shull Take zip as the path as well as a query arg. 3eea848
@daspecster Merge pull request #10 from exupero/master
Grab zip from URL path as alternative to query arg
04ddfd1
Showing with 4 additions and 0 deletions.
  1. +4 −0 zipapiserver.py
View
4 zipapiserver.py
@@ -16,11 +16,15 @@ def do_GET(s):
# Get the zip from the data
qs = {}
path = s.path
+ the_zip = None
if '?' in path:
path, tmp = path.split('?', 1)
qs = urlparse.parse_qs(tmp)
the_zip = qs['zip']
+ elif path:
+ the_zip = [path.strip('/')]
+ if the_zip:
# Query database with the ZIP and pull the city, state, country
conn = sqlite3.connect('zipcodes.db')
c = conn.cursor()

No commit comments for this range

Something went wrong with that request. Please try again.