没有从JSON feed中推送我需要的值

时间:2017-03-29 19:35:02

标签: json google-apps-script

我没有从JSON解析中获取输出。

function pullJSON(data) {
 var url="https://www.eventbriteapi.com/v3/subcategories/?event_status=live&token=XXXXXXXXX&page_count=4"; // Paste your JSON URL here
  
   var response = UrlFetchApp.fetch(url); // get feed
 var data = JSON.parse(response.getContentText()); //
  
var keys = Object.keys(data).map(function(key){ 
  Logger.log(key + ':' + data[key]);
  return key + ':' + data[key]});

我只需要子类别:请参阅下面的JSON

{
"pagination": 
        {
        "object_count": 185, 
        "page_number": 1,             
        }, 

"subcategories": 
        {
        "resource_uri":https://www.eventbriteapi.com", 
        "id": "1001", 
        "name": "Startups & Small Business", 
        }
}, 

0 个答案:

没有答案