The moment it happens
Send a link to Telegram and get a WordPress draft
Share a product page, article or forum thread with your bot and a WordPress draft based on it is created, with the edit link sent back to you.
- Runs
- The moment it happens
- Apps
- Telegram, WordPress
- AI
- Yes, uses the built-in AI allowance
- Access
- WordPress author+; bot token
Send this to your assistant
Create a ClickRuntime automation: when I send a URL to my Telegram bot, fetch the page, write a WordPress post from it with AI, save it as a draft and reply with the edit link.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
An affiliate blogger who reviews kitchen gadgets finds most of their ideas on the go: a new product page, a review thread, an article about a recall. They save links in a notes app and rarely get back to them, because starting a post from a link means reading the page again and writing from scratch.
With this bot, they send the link to Telegram the moment they find it. The page is fetched, AI writes a draft post from its content with a link back, and it is saved in WordPress. The bot replies with the edit link, so the idea is already a draft by the time they sit down.
What you get out of it
Ideas captured as drafts
A link sent from your phone becomes a draft within a minute. Good ideas stop dying in a notes app.
A head start on every post
The draft pulls in the key facts from the page. You add your own opinion and experience instead of starting with a blank editor.
Works with almost any page
Product pages, news articles and forum threads all work. Anything you can open in a browser can become a draft.
Drafts only
Nothing is published until you edit and publish it yourself. Your site only shows posts you are happy with.
How it works
What happens, step by step
When you send a link to your Telegram bot, ClickRuntime fetches that page and pulls out its main text.
AI writes a blog draft from the page, following any note you added, and links back to the source.
The draft is saved in WordPress.
The bot replies with the draft's title and edit link.
Before it runs live
- Connect Telegram
- Connect WordPress
- Paste your automation's link into the other app's webhook settings
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 Telegram and WordPress steps into one automation
Under the hood
The code that runs this automation
import re
from bs4 import BeautifulSoup
from clickruntime import on_event, credentials, http, ai
SCHEMA = {"type": "object", "properties": {k: {"type": "string"} for k in ["title", "excerpt", "body_html"]}, "required": ["title", "excerpt", "body_html"]}
WP = "https://blog.example.com/wp-json/wp/v2"
def wp(method, path, **kw):
r = http.request(method, f"{WP}/{path}", auth=(credentials.secret("WP_USER"), credentials.secret("WP_APP_PASSWORD")), **kw)
r.raise_for_status()
return r.json()
def telegram(method, **payload):
return http.post(f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/{method}", json=payload).json()
@on_event
def handle(event):
msg = (event.json or {}).get("message") or {}
found = re.search(r"https://\S+", msg.get("text", ""))
if not found:
return {"ignored": True}
url, note = found.group(0), msg["text"].replace(found.group(0), "").strip()
page = BeautifulSoup(http.get(url, headers={"User-Agent": "Mozilla/5.0"}).text, "html.parser")
text = " ".join(p.get_text(" ", strip=True) for p in page.find_all(["h1", "h2", "p", "li"]))[:6000]
if len(text) < 200:
telegram("sendMessage", chat_id=msg["chat"]["id"], text="I couldn't read that page.")
return {"read": False}
art = ai.generate(f"Write a blog draft (HTML body) based on this page, linking to {url}. Note: {note or 'none'}\n{text}", json_schema=SCHEMA, max_output_tokens=1800).json
post = wp("POST", "posts", json={"title": art["title"], "excerpt": art["excerpt"], "content": art["body_html"], "status": "draft"})
telegram("sendMessage", chat_id=msg["chat"]["id"], text=f"Draft saved: {art['title']}\nhttps://blog.example.com/wp-admin/post.php?post={post['id']}&action=edit")
return {"draft": post["id"]}FAQ
Common questions
What if the page cannot be read?
Does it link to the original page?
Can I add notes with the link?
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 PDF sent to Telegram into a blog post you approve
Send a PDF to your bot and it becomes a WordPress draft; tap Approve in Telegram and the post goes live.
See how it worksPublish a weekly SEO blog post and get the link on Telegram
Every week the next keyword on your list becomes a blog post on your WordPress site, and Telegram sends you the link as soon as it is up.
See how it worksRewrite new feed articles for your site and share them on Telegram
New articles from the feeds you follow are rewritten as posts on your WordPress site and shared on your Telegram channel with the link.
See how it worksKeep exploring
Set up “Send a link to Telegram and get a WordPress draft” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.