(Classic Google Sites) Check "Recent Site Activity" via google script

23 views
Skip to first unread message

jmm0979

unread,
Jun 11, 2021, 7:25:59 PM6/11/21
to google-apps-sc...@googlegroups.com
Is there a way to capture the recent site activity date in the Recent Site Activity page via google script?
I checked the lastUpdatedDate() but it does not provide the information I needed.

Thanks!

Clark Lind

unread,
Jun 13, 2021, 8:21:55 AM6/13/21
to Google Apps Script Community
Not directly, as you found out. But I think you should be able to do it indirectly with the method you found, with just some slight modification.

var site = SitesApp.getSite("example.com", "mysite");
var pages = site.getChildren();
pages.forEach( page => {
    Logger.log(page.getName() + " was last updated " + page.getLastUpdated());
})

Or if the above only gets the first level down, maybe try  site.getAllDescendants()

Clark Lind

unread,
Jun 13, 2021, 8:23:31 AM6/13/21
to Google Apps Script Community
Or, possibly. you could use the UrlFetch to get the Recent Site Activity page directly, and just parse the text content.
Reply all
Reply to author
Forward
0 new messages