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
Every Monday you get one email with the week's Reddit posts about your product: subreddit, title, a link to the thread and one line on why it matters. The subreddits you name are checked every morning, and only posts whose title contains your product's name are passed to the AI, which is given your one-line description and decides whether each is really about you, so namesakes like a band or an everyday word are left out.
Each confirmed mention is added to your Google Sheet as it is found, and a post already on the sheet is never reported again. If a subreddit cannot be read, or a post cannot be checked, the run is marked as failed and names it, and Monday's email says so too, including in the subject. If the sheet cannot be read, nothing is checked until it can. A week with no mentions still sends the email, saying so.
You need Reddit, OpenAI, Google Sheets and Gmail connected; your product's name, a one-line description of it, the subreddits to watch and the address for the email; and a Google Sheet tab headed Date reported, Post ID, Subreddit, Title, Link and Why it matters.
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 logErrormentionLogUrl. 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 emptylogRows to mentionLog.rows.Change logRows to mentionLog.rows.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 emptysubredditErrorIf a step below fails, save the error as subredditErrorsubreddit. 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 postErrorpost.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…permalink contains /comments/If permalink contains /comments/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 emptyreason to The AI gave no reason..Change reason to The AI gave no reason..relevance.output.verdict in lowercase is yesIf relevance.output.verdict in lowercase is yesmentionLine 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.title (reason).Show in the output: Not a real mention, skipped: title (reason).title.Show in the output: Skipped a matching post with no usable link: title.@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.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.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 emptyNot 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.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 MondayrunDate 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 0weekLines with a blank line and save it as digestSummary.Join weekLines with a blank line and save it as digestSummary.subjectNote to blank.Set subjectNote to blank.unreadSubreddits isn't emptyIf unreadSubreddits isn't emptyunreadSubreddits 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.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.readCount is 0If readCount is 0problemList.problems isn't emptyIf problems isn't emptymentionCount 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.readCount subreddit(s) and logged mentionCount new mention(s). emailNote.Finish the run: Checked readCount subreddit(s) and logged mentionCount new mention(s). emailNote.