On a schedule
Draft a blog post on this week's trending topic
Every Monday the week's trending topics in your field are checked and a WordPress draft is created on the best one you haven't covered.
- Runs
- On a schedule
- Apps
- Perplexity, WordPress
- AI
- Optional
- Access
- Perplexity key; WP author
Send this to your assistant
Create a ClickRuntime automation: every Monday, ask Perplexity for this week's trending topics in web security, pick one I haven't covered, create a WordPress draft about it and email me the link.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Readers come back to blogs that cover what is happening now. But spotting the right story each week, checking that you have not already covered it and researching it takes time that small teams rarely have on a Monday.
Specialist blogs, agencies and B2B companies use it to publish timely posts in their field every week, with research and a draft waiting at the start of the week.
What you get out of it
Timely without the scramble
A draft on this week's topic is waiting on Monday morning.
No repeated subjects
Topics already drafted are remembered, so you never cover the same story twice.
Sources included
Editors can check every claim from the list at the end of the draft.
Works with or without AI writing
With the AI step you get a full draft; without it, a research outline to write from.
How it works
What happens, step by step
Every Monday, ClickRuntime asks Perplexity for this week's trending topics in your field.
It picks the first topic you have not covered before.
The post is written from fresh research, or an outline is prepared if AI is not used.
A WordPress draft is created, and you get an email with the link.
Before it runs live
- Connect Perplexity
- Connect WordPress
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
- Run it at a different time, more or less often, or only on weekdays
- 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 Perplexity and WordPress steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_trigger, credentials, http, state, notify, ai
SITE, WP_USER, FIELD = "https://blog.example.com", "content-bot", "web security"
def sonar(prompt):
r = http.post("https://api.perplexity.ai/chat/completions", headers={"Authorization": f"Bearer {credentials.secret('PERPLEXITY_API_KEY')}"},
json={"model": "sonar", "messages": [{"role": "user", "content": prompt}]}, timeout=90).json()
return r["choices"][0]["message"]["content"], [s["url"] for s in r.get("search_results", [])]
def wp_draft(title, html):
r = http.post(f"{SITE}/wp-json/wp/v2/posts", auth=(WP_USER, credentials.secret("WP_APP_PASSWORD")),
json={"title": title, "content": html, "status": "draft"})
return r.raise_for_status() or r.json()["id"]
@on_trigger
def run(event):
covered = state.get("covered") or []
trends, _ = sonar(f"List this week's five most discussed topics in {FIELD}, one per line, no numbering.")
topic = next((t.strip("-• ") for t in trends.splitlines() if t.strip() and t.strip("-• ") not in covered), None)
if not topic:
return {"drafted": False}
facts, links = sonar(f"Research for a blog post: {topic}. Key facts, what changed, what readers should do.")
try:
html = ai.generate(f"Write an 800-word blog post in HTML (h2, p, ul) about {topic} from:\n{facts[:4000]}",
max_output_tokens=1800).text
except (ai.AINotIncluded, ai.AILimitReached):
html = f"<p>{facts}</p>" # research outline only
post_id = wp_draft(topic, html + "<h2>Sources</h2><ul>" + "".join(f"<li>{l}</li>" for l in links) + "</ul>")
notify.email_me(f"Draft ready: {topic}", f"{SITE}/wp-admin/post.php?post={post_id}&action=edit")
state.set("covered", (covered + [topic])[-200:])
return {"topic": topic}FAQ
Common questions
How is the topic picked?
Can I approve the topic first?
Is anything published automatically?
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
Turn a keyword list into researched WordPress drafts
Each day the next keyword on your list is researched, written up as an SEO article with sources, and saved as a WordPress draft, with a Slack link to review it.
See how it worksGet alerts about security issues that affect you
When a serious vulnerability is published for software you use, your security channel hears about it the same hour.
See how it worksHear about new releases of the tools you use
When a library or tool you depend on ships a new version, your dev channel gets the release notes link.
See how it worksKeep exploring
Set up “Draft a blog post on this week's trending topic” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.