0
我正在構建一個腳本來調用FB api並將響應導入到Google工作表中。使用JSON.stringify
後,我有如下反應:將數據從JSON響應傳遞到Google Spreadsheet中
{
"data":[
{
"id":"page_id/insights/page_impressions/day",
"name":"page_impressions",
"period":"day",
"values":[
{
"value":26023596,
"end_time":"2016-11-17T08:00:00+0000"
},
{
"value":24447386,
"end_time":"2016-11-18T08:00:00+0000"
},
{
"value":31057386,
"end_time":"2016-11-19T08:00:00+0000"
}
],
"title":"Daily Total Impressions",
"description":"Daily: The number of impressions seen of any content associated with your Page. (Total Count)"
},
{
"id":"page_id/insights/page_impressions/week",
"name":"page_impressions",
"period":"week",
"values":[
{
"value":233007217,
"end_time":"2016-11-17T08:00:00+0000"
},
{
"value":200263630,
"end_time":"2016-11-18T08:00:00+0000"
},
{
"value":194289364,
"end_time":"2016-11-19T08:00:00+0000"
}
],
"title":"Weekly Total Impressions",
"description":"Weekly: The number of impressions seen of any content associated with your Page. (Total Count)"
},
{
"id":"page_id/insights/page_impressions/days_28",
"name":"page_impressions",
"period":"days_28",
"values":[
{
"value":867302439,
"end_time":"2016-11-17T08:00:00+0000"
},
{
"value":868201060,
"end_time":"2016-11-18T08:00:00+0000"
},
{
"value":874965509,
"end_time":"2016-11-19T08:00:00+0000"
}
],
"title":"28 Days Total Impressions",
"description":"28 Days: The number of impressions seen of any content associated with your Page. (Total Count)"
}
],
"paging":{
"previous":"https://graph.facebook.com/v2.3/page_id/insights/page_impressions?access_token=my_token&since=1479068112&until=1479327312",
"next":"https://graph.facebook.com/v2.3/page_id/insights/page_impressions?access_token=my_token&since=1479586512&until=1479845712"
}
}
我想進口的價值Daily Total Impressions
,Weekly Total Impressions
和28 Days Total Impressions
在我的谷歌片,但是我不知道我應該如何進行。我知道如何訪問特定的值,例如:data.data[0].values[0].value
。但就是這些。真的不知道我應該接下來做什麼。
理想情況下,我希望能夠創建一個新的數組並將數據推送到那裏。 (var data = []; data.push(???)
)
但我完全失去了多個數組/對象。
謝謝!