如何从谷歌网站页面获取评论?

时间:2017-05-17 14:13:11

标签: google-apps-script

我想在google网站页面上获取评论数据。

我找到了一个合适的方法“getComments”,但它已经被弃用了。 (我试图使用它,但它没有用。返回没有数组) https://developers.google.com/apps-script/reference/sites/page#getcomments

有谁知道从网页上获取评论的好方法? 我只是想从某些页面做出一种“用户评论排名”。

感谢。

1 个答案:

答案 0 :(得分:0)

您可能需要检查Comment类,然后检查getContent()方法,该方法将此注释的内容作为字符串返回。

var pages = SitesApp.getSite('example.com', 'mysite').getChildren();
var comments = pages[0].getComments();
var content = comments[0].getContent()
相关问题