I'm experimenting with Sunlight Foundation Capitol words API and Webpy.
I'm able to retrieve the data from sunlight and store the results in a Webpy variable ($data) which is pass to the template.
It is possible to pass a templetor (webpy template system) variable to a Javascript and extract the results values?
I found a couple of JSON lectures and videos which I tried but so far can make it happen. I think that I might need to write the data into a JSON file before I could use it but at the same time I question myself because the results from sunlight are already formatted as JSON.
Here are two objects from the results: It would be a great help if some one could suggest how to manage this JSON with a Javascript or provide some options. Thanks in advance
{ "num_found": 78682, "results": [ { "speaker_state": "OH", "speaker_first": "Tim", "congress": 110, "title": "30-SOMETHING WORKING GROUP", "origin_url": "http://origin.www.gpo.gov/fdsys/pkg/CREC-2007-03-26/html/CREC-2007-03-26-pt1-PgH3071-2.htm", "number": 52, "order": 13, "volume": 153, "chamber": "House", "session": 1, "id": "CREC-2007-03-26-pt1-PgH3071-2.chunk13", "speaking": [ "Civil war." ], "capitolwords_url": "http://capitolwords.org/date/2007/03/26/H3071-2_30-something-working-group/", "speaker_party": "D", "date": "2007-03-26", "bills": null, "bioguide_id": "R000577", "pages": "H3071-H3078", "speaker_last": "Ryan", "speaker_raw": "mr. ryan of ohio" }, { "speaker_state": null, "speaker_first": null, "congress": 110, "title": "[Filed on January 4, 2007]", "origin_url": "http://origin.www.gpo.gov/fdsys/pkg/CREC-2007-01-05/html/CREC-2007-01-05-pt1-PgH110.htm", "number": 2, "order": 57, "volume": 153, "chamber": "House", "session": 1, "id": "CREC-2007-01-05-pt1-PgH110.chunk57", "speaking": [ "Service and the Naval Transport Service) during World War II; " ], "capitolwords_url": "http://capitolwords.org/date/2007/01/05/H110_filed-on-january-4-2007/", "speaker_party": null, "date": "2007-01-05", "bills": null, "bioguide_id": null, "pages": "H110-H123", "speaker_last": null, "speaker_raw": "recorder" }]}
ليست هناك تعليقات:
إرسال تعليق