Uses the NPR API’s JSON output to generate a simple data structure containing a list of NPR stories.
The query method stores the full JSON-esque mapping in the data attribute and returns the list of story mappings. Additionally, a few properties are available on the class to allow easy retrieval of additional API metadata.
Parameters: |
|
---|
Make a query to the API, returns a list of story dictionaries and updates the data attribute.
Parameters: |
|
---|---|
Except: | Raises an NPRError when an error response is returned by the NPR API. Raises an urllib2.URLError or an urllib2.HTTPError when there is a problem accessing the NPR API service. |
Return type: | list of story mappings |
Makes requests to the NPR Story API.
Parameters: |
|
---|
Request data from the NPR API. Valid query parameters listed in the QUERY_TERMS constant. Returns the response string after checking for errors.
Parameters: |
|
---|---|
Except: | Raises an NPRError when an error response is returned by the NPR API. Raises an urllib2.URLError or an urllib2.HTTPError when there is a problem accessing the NPR API service. |
Return type: | string |