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(???)
)
但我完全失去了多个数组/对象。
谢谢!