Sorts the comments on your latest videos into asks, praise and complaints, and emails the counts with real quotes.
Uses
Claude
Gmail
Google Sheets
YouTube
What your YouTube viewers are saying
channelId to blank.Set channelId to blank.digestRecipient to blank.Set digestRecipient to blank.videosToCheck to 3.Set videosToCheck to 3.commentsPerVideo to 15.Set commentsPerVideo to 15.quotesPerTheme to 4.Set quotesPerTheme to 4.logSheetUrl to blank.Set logSheetUrl to blank.logSheetTab to Comment themes.Set logSheetTab to Comment themes.channelId. Save it as channel.Get the details of channelId. Save it as channel.channelName to your channel.Set channelName to your channel.channelNameErrorIf a step below fails, save the error as channelNameErrorTry
channel.title and save it as channelName.Trim channel.title and save it as channelName.On error
The channel has no title; calling it 'your channel'..Show in the output: The channel has no title; calling it 'your channel'..uploadsPlaylistId to blank.Set uploadsPlaylistId to blank.uploadsErrorIf a step below fails, save the error as uploadsErrorTry
channel.related_playlists.uploads and save it as uploadsPlaylistId.Trim channel.related_playlists.uploads and save it as uploadsPlaylistId.On error
That channel did not come back with an uploads playlist..Show in the output: That channel did not come back with an uploads playlist..uploadsPlaylistId is emptyIf uploadsPlaylistId is emptyYes
No
No steps
uploadsPlaylistId. Save it as uploads.List the videos in uploadsPlaylistId. Save it as uploads.videos to uploads.items.Set videos to uploads.items.reviewedCount to 0.Set reviewedCount to 0.requestCount to 0.Set requestCount to 0.praiseCount to 0.Set praiseCount to 0.complaintCount to 0.Set complaintCount to 0.otherCount to 0.Set otherCount to 0.requestQuotes to an empty list.Set requestQuotes to an empty list.praiseQuotes to an empty list.Set praiseQuotes to an empty list.complaintQuotes to an empty list.Set complaintQuotes to an empty list.videoLines to an empty list.Set videoLines to an empty list.video in videos:For each video in videos:videoTitle to Untitled video.Set videoTitle to Untitled video.videoTitleErrorIf a step below fails, save the error as videoTitleErrorTry
video.title and save it as videoTitle.Trim video.title and save it as videoTitle.On error
A video in the uploads list had no title..Show in the output: A video in the uploads list had no title..videoId to blank.Set videoId to blank.videoIdErrorIf a step below fails, save the error as videoIdErrorTry
video.video_id and save it as videoId.Trim video.video_id and save it as videoId.On error
Skipped an uploads entry that had no video id..Show in the output: Skipped an uploads entry that had no video id..videoId isn't emptyIf videoId isn't emptyYes
videoCommentCount to 0.Set videoCommentCount to 0.comments to an empty list.Set comments to an empty list.commentReadErrorIf a step below fails, save the error as commentReadErrorTry
comments to the items from the YouTube “List video comments” step.Change comments to the items from the YouTube “List video comments” step.On error
videoTitle.Show in the output: Could not read the comments on: videoTitle.comment in comments:For each comment in comments:commentText to blank. Set commentText to blank.commentTextError If a step below fails, save the error as commentTextErrorTry
comment.text and save it as commentText.Trim comment.text and save it as commentText.On error
videoTitle.Show in the output: Skipped a comment with no text on: videoTitle.commentText isn't empty If commentText isn't emptyYes
commentAuthor to A viewer.Set commentAuthor to A viewer.commentAuthorErrorIf a step below fails, save the error as commentAuthorErrorTry
comment.author and save it as commentAuthor.Trim comment.author and save it as commentAuthor.On error
A comment had no author name; recording it as 'A viewer'..Show in the output: A comment had no author name; recording it as 'A viewer'..commentAuthor is emptyIf commentAuthor is emptyYes
commentAuthor to A viewer.Change commentAuthor to A viewer.No
No steps
sortPrompt to You are sorting one comment left on a YouTube video into exactly one bucket.Set sortPrompt to You are sorting one comment left on a YouTube video into exactly one bucket.
Reply with EXACTLY one of these words and nothing else - no punctuation, no explanation, and never quote the comment back:
request - the viewer is asking for something: a topic, a follow-up, a tutorial, a feature, more detail
praise - the viewer is saying something positive about the video or the channel
complaint - the viewer is unhappy, confused, or reporting a problem
other - anything else, including spam, off-topic chatter and one-word reactions
Video: videoTitle
Comment: commentText.bucket to blank.Set bucket to blank.sortErrorIf a step below fails, save the error as sortErrorTry
. with in the response text from the Claude “Ask Claude” step in lowercase and save it as bucket.Replace . with in the response text from the Claude “Ask Claude” step in lowercase and save it as bucket.On error
videoTitle.Show in the output: Could not sort a comment on: videoTitle.bucket isn't emptyIf bucket isn't emptyYes
reviewedCount.Add 1 to reviewedCount.videoCommentCount.Add 1 to videoCommentCount.quoteLine to - @commentText truncated to 220 characters using ... as the ellipsis - commentAuthor (on videoTitle).Set quoteLine to - @commentText truncated to 220 characters using ... as the ellipsis - commentAuthor (on videoTitle).bucket is requestIf bucket is requestYes
requestCount.Add 1 to requestCount.requestQuotes is less than quotesPerThemeIf the length of requestQuotes is less than quotesPerThemeYes
quoteLine to the end of requestQuotes and save it as requestQuotes.Add quoteLine to the end of requestQuotes and save it as requestQuotes.No
No steps
Else if @bucket is "praise"
praiseCount.Add 1 to praiseCount.praiseQuotes is less than quotesPerThemeIf the length of praiseQuotes is less than quotesPerThemeYes
quoteLine to the end of praiseQuotes and save it as praiseQuotes.Add quoteLine to the end of praiseQuotes and save it as praiseQuotes.No
No steps
Else if @bucket is "complaint"
complaintCount.Add 1 to complaintCount.complaintQuotes is less than quotesPerThemeIf the length of complaintQuotes is less than quotesPerThemeYes
quoteLine to the end of complaintQuotes and save it as complaintQuotes.Add quoteLine to the end of complaintQuotes and save it as complaintQuotes.No
No steps
Otherwise
otherCount.Add 1 to otherCount.No
No steps
No
No steps
videoTitle - videoCommentCount as text sorted to the end of videoLines and save it as videoLines.Add - videoTitle - videoCommentCount as text sorted to the end of videoLines and save it as videoLines.No
No steps
reviewedCount is 0If reviewedCount is 0Yes
No
No steps
requestBlock to No requests this time..Set requestBlock to No requests this time..requestQuotes isn't emptyIf requestQuotes isn't emptyYes
requestQuotes with a new line and save it as requestBlock.Join requestQuotes with a new line and save it as requestBlock.No
No steps
requestSection to WHAT THEY ASKED FOR (requestCount as text)Set requestSection to WHAT THEY ASKED FOR (requestCount as text)
requestBlock.praiseBlock to No praise this time..Set praiseBlock to No praise this time..praiseQuotes isn't emptyIf praiseQuotes isn't emptyYes
praiseQuotes with a new line and save it as praiseBlock.Join praiseQuotes with a new line and save it as praiseBlock.No
No steps
praiseSection to WHAT THEY PRAISED (praiseCount as text)Set praiseSection to WHAT THEY PRAISED (praiseCount as text)
praiseBlock.complaintBlock to No complaints this time..Set complaintBlock to No complaints this time..complaintQuotes isn't emptyIf complaintQuotes isn't emptyYes
complaintQuotes with a new line and save it as complaintBlock.Join complaintQuotes with a new line and save it as complaintBlock.No
No steps
complaintSection to WHAT THEY COMPLAINED ABOUT (complaintCount as text)Set complaintSection to WHAT THEY COMPLAINED ABOUT (complaintCount as text)
complaintBlock.headerLine to Here is what viewers said on the last the length of videoLines as text videos from channelName.Set headerLine to Here is what viewers said on the last the length of videoLines as text videos from channelName.countsBlock to Comments sorted: reviewedCount as textSet countsBlock to Comments sorted: reviewedCount as text
Asked for something: requestCount as text
Praised: praiseCount as text
Complained: complaintCount as text
Everything else: otherCount as text.digestBody to headerLineSet digestBody to headerLine
countsBlock
requestSection
praiseSection
complaintSection
VIDEOS CHECKED
videoLines joined by a new line
Every quote above is copied word for word from a comment on your channel; nothing here is wording the AI came up with.digestRecipient.Send an email to digestRecipient.
Subject: What your viewers said on channelNamedigestBodylogSheetUrl isn't emptyIf logSheetUrl isn't emptyYes
logErrorIf a step below fails, save the error as logErrorTry
logSheetTab in logSheetUrl.Add a row to logSheetTab in logSheetUrl.On error
The digest was emailed but the run could not be logged to your spreadsheet..Show in the output: The digest was emailed but the run could not be logged to your spreadsheet..No
No steps