【发布时间】:2019-10-21 11:52:56
【问题描述】:
我希望修改 YouTube API Apps 脚本以允许在提示中使用逗号分隔值;或替代方法。
我一直在学习如何使用以下示例通过 Apps 脚本从 YouTube API 中提取数据:https://developers.google.com/youtube/v3/quickstart/apps-script
我能够执行代码,但现在我正在学习如何将多个字符串值添加到提示符中。在示例中,您添加一个频道名称(字符串),它将输出一个 ID 和观看次数。我想看看如何允许脚本采用多个值。
添加:以 RedBull、JimmyKimmelLive、ESPN 为例。我认为需要在下面的代码中使用 getResponseText 修改调用。虽然,我不确定您是否必须以不同的方式调用它以允许多个值。
var ui = SpreadsheetApp.getUi();
var channelName = ui.prompt("Enter the channel name: ").getResponseText();
channelsListByUsername('snippet,contentDetails,statistics',
{'forUsername': channelName});
【问题讨论】:
标签: google-apps-script youtube-data-api