Every Monday, emails you the Reddit posts that mention your product, checked by AI so namesakes are filtered out, with links.
Uses
Gmail
Google Sheets
OpenAIReddit
Get a weekly email of Reddit posts about your product
productName to blank.Set productName to blank.productDescription to blank.Set productDescription to blank.subreddits to blank.Set subreddits to blank.digestRecipient to blank.Set digestRecipient to blank.mentionLogUrl to blank.Set mentionLogUrl to blank.mentionLogTab to Reddit mentions.Set mentionLogTab to Reddit mentions.postsPerSubreddit to 100.Set postsPerSubreddit to 100.runDate.Get today's date and save it as runDate.logRows to an empty list.Set logRows to an empty list.logErrorIf a step below fails, save the error as logErrorTry
mentionLogUrl. Save it as mentionLog.Read the rows of mentionLogUrl. Save it as mentionLog.Date reported, Post ID, Subreddit, Title, Link, Why it matters] with mentionLog.headers and save it as logColumns.Compare [Date reported, Post ID, Subreddit, Title, Link, Why it matters] with mentionLog.headers and save it as logColumns.logColumns.only_in_first isn't emptyIf logColumns.only_in_first isn't emptyYes
No
No steps
logRows to mentionLog.rows.Change logRows to mentionLog.rows.On error
logError.message.Stop and report a problem: Could not read the '@mentionLogTab' tab of your mention log, so nothing was checked: the log is what stops a post being reported twice. Check the sheet link in 'mentionLogUrl', the tab name in 'mentionLogTab', and that the connected Google account can open the sheet. Reason: logError.message.Post ID from every item in logRows and save it as reportedIds.Get Post ID from every item in logRows and save it as reportedIds.productBrief to The product: productNameSet productBrief to The product: productName
What it is: productDescription.mentions to an empty list.Set mentions to an empty list.problems to an empty list.Set problems to an empty list.unreadSubreddits to an empty list.Set unreadSubreddits to an empty list.readCount to 0.Set readCount to 0.subreddits by , and save it as subredditList.Split subreddits by , and save it as subredditList.subredditEntry in subredditList:For each subredditEntry in subredditList:subredditEntry and save it as subreddit.Trim subredditEntry and save it as subreddit.subreddit isn't emptyIf subreddit isn't emptyYes
subredditErrorIf a step below fails, save the error as subredditErrorTry
subreddit. Save it as listing.List posts in r/subreddit. Save it as listing.readCount.Add 1 to readCount.post in listing.posts:For each post in listing.posts:postError If a step below fails, save the error as postErrorTry
post.title and save it as title.Trim post.title and save it as title.post.id and save it as postId.Trim post.id and save it as postId.post.permalink and save it as permalink.Trim post.permalink and save it as permalink.title contains productName (ignoring case) and reportedIds doesn't contain…If title contains productName (ignoring case) and reportedIds doesn't contain…Yes
permalink contains /comments/If permalink contains /comments/Yes
link to https://www.reddit.com@permalink.Set link to https://www.reddit.com@permalink.postBrief to Post title: titleSet postBrief to Post title: title
Posted in: r/subreddit.prod… and save it as relevance.Run an AI agent: Is this Reddit post about the product below, or does its title only share the name? prod… and save it as relevance.relevance.output.reason and save it as reason.Trim relevance.output.reason and save it as reason.reason is emptyIf reason is emptyYes
reason to The AI gave no reason..Change reason to The AI gave no reason..No
No steps
relevance.output.verdict in lowercase is yesIf relevance.output.verdict in lowercase is yesYes
mentionLine to r/subreddit - titleSet mentionLine to r/subreddit - title
link
Why it matters: reason.mentionLogTab in mentionLogUrl.Add a row to mentionLogTab in mentionLogUrl.postId to the end of reportedIds and save it as reportedIds.Add postId to the end of reportedIds and save it as reportedIds.mentionLine to the end of mentions and save it as mentions.Add mentionLine to the end of mentions and save it as mentions.No
title (reason).Show in the output: Not a real mention, skipped: title (reason).No
title.Show in the output: Skipped a matching post with no usable link: title.No
No steps
On error
@post.title in r/subreddit: postError.message to the end of problems and save it as problems.Add Could not check or log @post.title in r/subreddit: postError.message to the end of problems and save it as problems.On error
subreddit to the end of unreadSubreddits and save it as unreadSubreddits.Add r/subreddit to the end of unreadSubreddits and save it as unreadSubreddits.subreddit: subredditError.message to the end of problems and save it as problems.Add Could not read r/subreddit: subredditError.message to the end of problems and save it as problems.No
No steps
mentions and save it as mentionCount.Count the items in mentions and save it as mentionCount.problems with a new line and save it as problemList.Join problems with a new line and save it as problemList.problemNote to blank.Set problemNote to blank.problems isn't emptyIf problems isn't emptyYes
Not everything could be checked on this run: @problemList The next daily check tries again, but posts that have dropped out of a subreddit's newest @postsPerSu... and save it as problemNote.Build the text Not everything could be checked on this run: @problemList The next daily check tries again, but posts that have dropped out of a subreddit's newest @postsPerSu... and save it as problemNote.No
No steps
emailNote to They will be in Monday's email..Set emailNote to They will be in Monday's email..runDate is MondayIf the weekday name of runDate is MondayYes
runDate and save it as weekStart.Get the date 6 days before runDate and save it as weekStart.logRows where item["Date reported"] is greater than or equal to weekStart and item["Date… and save it as earlierThisWeek.Keep each item in logRows where item["Date reported"] is greater than or equal to weekStart and item["Date… and save it as earlierThisWeek.weekLines to an empty list.Set weekLines to an empty list.loggedMention in earlierThisWeek:For each loggedMention in earlierThisWeek:loggedMention.Subreddit - loggedMention.Title Add r/loggedMention.Subreddit - loggedMention.Title
loggedMention.Link
Why it matters: loggedMention["Why it matters"] to the end of weekLines and save it as weekLines.weekLines and mentions into one list and save it as weekLines.Combine weekLines and mentions into one list and save it as weekLines.weekLines and save it as weekCount.Count the items in weekLines and save it as weekCount.digestSummary to No new mentions were found this week..Set digestSummary to No new mentions were found this week..weekCount is greater than 0If weekCount is greater than 0Yes
weekLines with a blank line and save it as digestSummary.Join weekLines with a blank line and save it as digestSummary.No
No steps
subjectNote to blank.Set subjectNote to blank.unreadSubreddits isn't emptyIf unreadSubreddits isn't emptyYes
unreadSubreddits with , and save it as unreadNames.Join unreadSubreddits with , and save it as unreadNames.- could not read @unreadNames and save it as subjectNote.Build the text - could not read @unreadNames and save it as subjectNote.No
No steps
runDate readable as “Monday, November 2” and save it as weekLabel.Make runDate readable as “Monday, November 2” and save it as weekLabel.digestRecipient.Send an email to digestRecipient.
Subject: productName on Reddit - weekCount new mention(s), week to weekLabel@subjectNoteReddit posts about productName found in the week to weekLabel.
digestSummary@problemNote
Subreddits watched: subreddits
Every mention above is also in your mention log, which keeps it out of later emails.This week's email went to @digestRecipient. and save it as emailNote.Build the text This week's email went to @digestRecipient. and save it as emailNote.No
No steps
readCount is 0If readCount is 0Yes
problemList.No
No steps
problems isn't emptyIf problems isn't emptyYes
mentionCount new mention(s), but not everything could be checked:Stop and report a problem: Logged mentionCount new mention(s), but not everything could be checked:
problemList
emailNote.No
No steps
readCount subreddit(s) and logged mentionCount new mention(s). emailNote.Finish the run: Checked readCount subreddit(s) and logged mentionCount new mention(s). emailNote.