Skip to content

Instantly share code, notes, and snippets.

@xtai
Created October 6, 2014 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xtai/1094299c475c10db2bf0 to your computer and use it in GitHub Desktop.
Save xtai/1094299c475c10db2bf0 to your computer and use it in GitHub Desktop.
json in python
import json, urllib
url = "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_week.geojson"
response = urllib.urlopen(url);
data = json.loads(response.read())
i = 0
for x in data['features']:
i += 1
print i, x['properties']['title']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment