Every 15 minutes
Moderate Facebook comments and log their sentiment
New comments on your Page are sorted by AI: spam is hidden, questions get a reply, and every comment is logged with its sentiment in your sheet.
- Runs
- Every 15 minutes
- Apps
- Facebook Pages, Google Sheets
- AI
- Yes, uses the built-in AI allowance
- Access
- pages_read_engagement, pages_manage_engagement; Sheet edit
Send this to your assistant
Create a ClickRuntime automation: every 15 minutes, check new comments on my Facebook Page posts. Hide spam, reply to simple questions, log each comment with its sentiment in my Comments sheet, and email me about any angry ones.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A restaurant's Facebook Page gets comments every day: compliments, booking questions, the odd complaint, and a steady trickle of spam links. The owner checks once a day at best, so spam sits under posts for hours and questions go unanswered.
Every new comment is now read within 15 minutes. Spam is hidden, simple questions get a polite reply, and every comment is logged in a sheet with its sentiment. Angry comments come straight to the owner's inbox so they can respond personally.
What you get out of it
A clean Page
Spam links and scams are hidden before most followers see them.
Questions answered quickly
Simple questions about hours or bookings get a reply in minutes.
Complaints reach you fast
Negative comments are emailed straight away, so you can step in personally.
Sentiment over time
The sheet shows how people feel about your posts week by week.
How it works
What happens, step by step
Every 15 minutes, ClickRuntime checks your recent Page posts for new comments.
It skips comments it has already handled.
AI marks each one as spam, question, positive, neutral or negative; spam is hidden and simple questions get a reply.
Every comment is logged in your sheet with its sentiment, and negative ones are emailed to you.
Before it runs live
- Connect Facebook Pages
- Connect your Google Sheets account and pick the spreadsheets it may use
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Slack
- Combine it with other Facebook Pages and Google Sheets steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, ai, state, notify, report_fetched
PAGE_ID, SHEET_ID = "1234567890", "your-spreadsheet-id"
G, FAQ = "https://graph.facebook.com/v21.0", "Open Tue-Sun 12-22. Book at northwind-kitchen.example/book."
@on_trigger
def run(event):
t, seen, rows = {"access_token": credentials.connection("facebook", "work")}, set(state.get("seen") or []), []
posts = http.get(f"{G}/{PAGE_ID}/posts", params={**t, "limit": 10}).json()["data"]
new = [c for p in posts for c in http.get(f"{G}/{p['id']}/comments", params=t).json()["data"] if c["id"] not in seen]
report_fetched(len(new))
if not new:
return {"summary": "No new comments"}
for c in new:
r = ai.generate(f"Facts: {FAQ}\nComment: {c['message'][:500]}", max_output_tokens=150, json_schema={"type": "object",
"properties": {"label": {"enum": ["spam", "question", "positive", "neutral", "negative"]}, "reply": {"type": "string"}}}).json
if r["label"] == "spam":
http.post(f"{G}/{c['id']}", data={**t, "is_hidden": "true"})
elif r["label"] == "question" and r.get("reply"):
http.post(f"{G}/{c['id']}/comments", data={**t, "message": r["reply"]})
elif r["label"] == "negative":
notify.email_me("Negative comment on your Page", c["message"])
rows.append([c["created_time"], c["message"], r["label"]])
seen.add(c["id"])
sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
sheets.spreadsheets().values().append(spreadsheetId=SHEET_ID, range="Comments!A:C", valueInputOption="USER_ENTERED", body={"values": rows}).execute()
state.set("seen", list(seen)[-2000:])
return {"handled": len(new)}FAQ
Common questions
Does it delete comments?
What kind of questions does it answer?
Will it reply to complaints?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Share each new blog post on Facebook and log it
Each new article on your blog is shared on your Facebook Page with a short caption and recorded in your sheet.
See how it worksCreate Facebook ads from rows in a sheet
Each ad you describe in a sheet row, with copy, image, audience and budget, is created in Ads Manager as a paused ad, with its ids written back.
See how it worksPost about trending topics on Facebook and log each post
Each day a post about a trending topic in your field goes out on your Facebook Page, and it's logged in your sheet with its link.
See how it worksKeep exploring
Set up “Moderate Facebook comments and log their sentiment” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.