In Analyzing site content with GAS I showed how to analyze a Google Site and get the data as json, or file it on Google Drive. Next we want to do something with it. Here I'll use the Rest to Excel library to get data into both Google Sheets and Excel. We'll use the already created and hosted on gDrive file (although we could equally execute it from Excel or GAS and get love json using the same technique).
There are a few types of analysis we could do with the data, but we'll start with a very simple site profile - meaning a list of pages, urls and their parents.
The data created in Analyzing site content with GAS is hosted on gdrive, and we picked up the hosting name when it was created
Here's the link to the live data described below ( returned when we created it).
We're going to use the hosted property to access the data - this gives us a rest library entry that looks like this (we'll start with the excel version)
I've created a sheet called tagsite, and given the names to columns I want to populate that match their names in the data. Here's a snip of what will be created when i run it.
As with most Rest to Excel library examples, this is pretty much a one liner - referencing the library entry we created earlier and the sheet with the columns that need populated.
You'll find this implemented in the cDataSet.xlsm workbook.
The GAS version uses the functions created in GAS Rest Library migration, so the code is more or less the same as the VBA version.
This is implemented in the mcpher shared library
This is implemented in the restlibrary examples Google Spreadsheet.
Following the same steps as for excel, here is the result in a google sheet
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > GAS and sites >