First off, I will freely concede to being little more than a clumsy liberal arts guy who is completely self taught in this scripting thing. That said, I am attempting to get values from a the USGS Water Data Service using the code below:
def main(gaugeId):
# import modules
import urllib2, json
# create string
url = "http://waterservices.usgs.gov/nwis/iv/?format=json&sites=" + gaugeId + "¶meterCd=00060,00065"
# open connection to url
urlFile = urllib2.urlopen(url)
# load into local JSON list
jsonList = json.load(urlFile)
# extract and return
# how to get cfs, ft, and zulu time?
return [cfs, ft, time]
Although I have found some tutorials regarding how to extract the desired values from a JSON response, most are fairly simple. The difficulty I am having is extracting from what looks like a very complicated response this service is returning. Looking through the response, I can see what I want is the value from two different sections and a time value. Hence, I can look at the response and see what I need, I just cannot, for the life of me, figure out how to get these values extracted.