Even though ThingSpeak offers great charts, I'm interested in retrieving data from ThingSpeak and creating my own visualizations using Google Charts. When extracting a "feed" from ThingSpeak, the data is presented in a JSON object like the one below:
{
"channel":
{
"id": 9,
"name": "my_house",
"description": "Netduino Plus connected to sensors around the house",
"latitude": "40.44",
"longitude": "-79.996",
"field1": "Light",
"field2": "Outside Temperature",
"created_at": "2010-12-13T20:20:06-05:00",
"updated_at": "2014-02-26T12:43:04-05:00",
"last_entry_id": 6060625
},
"feeds":
[
{
"created_at": "2014-02-26T12:42:49-05:00",
"entry_id": 6060624,
"field1": "188",
"field2": "25.902335456475583"
},
{
"created_at": "2014-02-26T12:43:04-05:00",
"entry_id": 6060625,
"field1": "164",
"field2": "25.222929936305732"
}
]
}
I've been trying to find a way to extract the "created_at" and "field1" (and maybe "field2") data into a table or array format, but I haven't found a solution yet. This is the kind of output I want to achieve:
[
['created_at', 'field1', 'field2'],
['2014-02-26T12:42:49-05:00', 188, 25.902335456475583],
['2014-02-26T12:43:04-05:00', 164, 25.222929936305732]
]
Any suggestions on how I can accomplish this task?