Skip to content

Commit 0fd6025

Browse files
committed
"Updating samples to reflect recent changes."
1 parent ff866d6 commit 0fd6025

File tree

1 file changed

+15
-26
lines changed

1 file changed

+15
-26
lines changed

apps-script/youtube.gs

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/** START SECTION searchByTopic **/
21
// TITLE: Search by topic
32
// DESCRIPTION: use_function_comment
43
// API_METHOD: youtube.search.list
@@ -20,9 +19,7 @@ function searchByTopic() {
2019
Logger.log('[%s] Title: %s', item.id.videoId, item.snippet.title);
2120
}
2221
}
23-
/** END SECTION searchByTopic **/
2422

25-
/** START SECTION searchByKeyword **/
2623
// TITLE: Search by keyword
2724
// DESCRIPTION: use_function_comment
2825
// API_METHOD: youtube.search.list
@@ -42,10 +39,8 @@ function searchByKeyword() {
4239
Logger.log('[%s] Title: %s', item.id.videoId, item.snippet.title);
4340
}
4441
}
45-
/** END SECTION searchByKeyword **/
4642

4743

48-
/** START SECTION retrieveMyUploads **/
4944
// TITLE: Retrieve my uploads
5045
// DESCRIPTION: use_function_comment
5146
// API_METHOD: youtube.channels.list
@@ -97,9 +92,7 @@ function retrieveMyUploads() {
9792
}
9893
}
9994
}
100-
/** END SECTION retrieveMyUploads **/
10195

102-
/** START SECTION updateVideo **/
10396
// TITLE: Update video
10497
// DESCRIPTION: use_function_comment
10598
// API_METHOD: youtube.videos.update
@@ -139,9 +132,7 @@ function updateVideo() {
139132
YouTube.Videos.update(resource, 'id,snippet');
140133
}
141134
}
142-
/** END SECTION updateVideo **/
143135

144-
/** START SECTION addSubscription **/
145136
// TITLE: Subscribe to channel
146137
// DESCRIPTION: use_function_comment
147138
// API_METHOD: youtube.subscriptions.insert
@@ -173,9 +164,7 @@ function addSubscription() {
173164
}
174165
}
175166
}
176-
/** END SECTION addSubscription **/
177167

178-
/** START SECTION postChannelBulletin **/
179168
// TITLE: Post channel bulletin
180169
// DESCRIPTION: use_function_comment
181170
// API_METHOD: youtube.activities.insert
@@ -204,25 +193,26 @@ function postChannelBulletin() {
204193
var response = YouTube.Activities.insert(resource, 'snippet,contentDetails');
205194
Logger.log(response);
206195
}
207-
/** END SECTION postChannelBulletin **/
208196

209-
/** START SECTION spreadsheetAnalytics **/
210-
// TITLE: YouTube Analytics export Google Sheets
197+
// TITLE: Export YouTube Analytics data to Google Sheets
211198
// DESCRIPTION: use_function_comment
212-
// API_METHOD: youtubeanalytics.reports.query
199+
// API_METHOD: youtubeAnalytics.reports.query
213200
/**
214-
* This function uses the YouTube Analytics API to fetch data about our channel, creating
215-
* a new Google Sheet in our Drive with the data.
201+
* This function uses the YouTube Analytics API to fetch data about the
202+
* authenticated user's channel, creating a new Google Sheet in the user's Drive
203+
* with the data.
216204
*
217-
* The first part of this sample demonstrates a simple YouTube Analytics API call. This function
218-
* first fetches the active user's channel ID. Using this channel ID, the function makes an
219-
* analytics API call to retrieve view, likes, dislike and share data for the last 30 days. This
220-
* is returned in a response object containing a 2D array.
205+
* The first part of this sample demonstrates a simple YouTube Analytics API
206+
* call. This function first fetches the active user's channel ID. Using that
207+
* ID, the function makes a YouTube Analytics API call to retrieve views,
208+
* likes, dislikes and shares for the last 30 days. The API returns the data
209+
* in a response object that contains a 2D array.
221210
*
222-
* The second part of the sample constructs a Spreadsheet. This spreadsheet is placed in the active
223-
* user's Google Drive with the name 'YouTube Report' and date range in the title. The function
224-
* populates the spreadsheet with the API response, then locks columns and rows that will define
225-
* a chart axes. A stacked column chart is added for the spreadsheet.
211+
* The second part of the sample constructs a Spreadsheet. This spreadsheet
212+
* is placed in the authenticated user's Google Drive with the name
213+
* 'YouTube Report' and date range in the title. The function populates the
214+
* spreadsheet with the API response, then locks columns and rows that will
215+
* define a chart axes. A stacked column chart is added for the spreadsheet.
226216
*/
227217
function spreadsheetAnalytics() {
228218
// Get the channel ID
@@ -304,4 +294,3 @@ function spreadsheetAnalytics() {
304294
sheet.insertChart(chart);
305295

306296
}
307-
/** END SECTION spreadsheetAnalytics **/

0 commit comments

Comments
 (0)