Weekly
Write a weekly blog post with its cover image kept in Drive
Each week the next topic on your list becomes a WordPress draft with a cover image, and the image is saved in a Google Drive folder your team can reach.
- Runs
- Weekly
- Apps
- Google Drive, WordPress
- AI
- Yes, uses the built-in AI allowance
- Access
- Drive write; WordPress write
Send this to your assistant
Create a ClickRuntime automation: every Monday, write a blog post on my next topic, save the cover image to my Drive folder, upload it to WordPress and create the post as a draft.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A boutique interior design studio wants a weekly blog post to show its expertise, and every post needs a good cover image. Images end up scattered across laptops and email threads, and when the same photo is needed for a newsletter or a social post later, nobody can find it.
This automation drafts the post and keeps the image organised. Every Monday it takes the next topic, AI writes the article, the cover image is saved in a shared Google Drive folder and uploaded to the WordPress media library, and the post is created as a draft with the image attached. An email tells the team it is ready.
What you get out of it
One place for every cover image
All images live in a shared Drive folder named by post. Reusing one for a newsletter or social post takes seconds.
Drafts that are nearly ready
Each draft has its text and featured image in place. The team only needs to review and publish.
A weekly post without the scramble
Topics come from your list on a set day. The blog keeps moving even in busy weeks.
Review before it goes live
Posts are saved as drafts, so nothing is published until someone has checked the words and the picture.
How it works
What happens, step by step
Every Monday, ClickRuntime takes the next topic and its cover image from your list.
AI writes a blog post on the topic with a title, excerpt and headings.
The cover image is saved in your Google Drive folder and uploaded to your WordPress media library.
The post is created as a draft with the image as its featured image, and you get an email saying it is ready.
Before it runs live
- Connect Google Drive
- 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 Google Drive and WordPress steps into one automation
Under the hood
The code that runs this automation
import io
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaIoBaseUpload
from clickruntime import on_trigger, credentials, http, state, ai, notify
FOLDER_ID = "your-drive-folder-id"
TOPICS = [("Choosing a rug size for your living room", "https://images.example.com/rug.jpg")]
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()
@on_trigger
def run(event):
used = state.get("used") or 0
if used >= len(TOPICS):
notify.email_me("Blog topic list is empty", "Add more topics to keep the weekly post going.")
return {"posted": False}
topic, image_url = TOPICS[used]
art = ai.generate(f"Write a 1000-word blog post (HTML body, H2 headings) on '{topic}' for homeowners.", json_schema=SCHEMA, max_output_tokens=2048).json
image = http.get(image_url).content
drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
drive.files().create(body={"name": f"{art['title']}.jpg", "parents": [FOLDER_ID]}, media_body=MediaIoBaseUpload(io.BytesIO(image), mimetype="image/jpeg")).execute()
media = wp("POST", "media", data=image, headers={"Content-Disposition": 'attachment; filename="cover.jpg"', "Content-Type": "image/jpeg"})
post = wp("POST", "posts", json={"title": art["title"], "excerpt": art["excerpt"], "content": art["body_html"], "featured_media": media["id"], "status": "draft"})
notify.email_me(f"Draft ready: {art['title']}", f"https://blog.example.com/wp-admin/post.php?post={post['id']}&action=edit")
state.set("used", used + 1)
return {"draft": post["id"]}FAQ
Common questions
Where does the cover image come from?
Which Drive folder is used?
Is the image set as the featured image?
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
Add FAQ sections to your WordPress pages, with copies in Drive
Each week, pages without an FAQ get five questions and answers written from their content, and a copy of each FAQ is kept in a Google Drive document.
See how it worksBack up your WordPress posts to Google Drive every week
Every Sunday all your published posts are exported to a CSV file in your Drive backups folder, and you get an email with the link.
See how it worksGet a daily news digest in Slack
Each morning your team gets a short summary of what's new on the sites and blogs you follow.
See how it worksKeep exploring
Set up “Write a weekly blog post with its cover image kept in Drive” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.