Every hour
Improve a new video's title and description, then post it on X
When you publish a video, AI tightens its title, description and tags on YouTube, then announces it on X.
- Runs
- Every hour
- Apps
- X, YouTube
- AI
- Yes, uses the built-in AI allowance
- Access
- YouTube OAuth youtube; X tweet.write
Send this to your assistant
Create a ClickRuntime automation: every hour, check for new videos on my channel. Use AI to improve the title, description and tags for search, update the video, then post an announcement with the link on X.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A creator uploads from their phone straight after editing and writes the title in a hurry. By the time they think of a better one, the video's first and most important day is over. Announcing it on X is another job that often gets skipped.
Tidying the metadata within the hour and then announcing it gives each video a better start, while the creator moves on to the next one.
What you get out of it
A stronger first day
Better titles and descriptions are in place while YouTube is deciding who to show the video to.
Search-friendly tags
AI adds tags based on what the video is about, which helps it turn up in search.
Announced with the improved title
The X post uses the improved wording, so both places match.
Your original is kept
The old title goes into the run log, so you can switch back if you prefer it.
How it works
What happens, step by step
Every hour, ClickRuntime checks your channel for videos it has not seen before.
AI reads the title and description and writes an improved title, description and tags.
The video is updated on YouTube with the new wording.
An announcement with the link is posted on X.
Before it runs live
- Connect X
- Connect YouTube
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 X and YouTube 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, report_fetched, http, credentials, ai, state, log
def api(name, version):
return build(name, version, credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
SCHEMA = {"type": "object", "properties": {"title": {"type": "string"}, "description": {"type": "string"},
"tags": {"type": "array", "items": {"type": "string"}}, "post": {"type": "string"}}}
@on_trigger
def run(event):
yt, seen = api("youtube", "v3"), state.get("seen")
uploads = yt.channels().list(part="contentDetails", mine=True).execute()["items"][0]["contentDetails"]["relatedPlaylists"]["uploads"]
ids = [i["contentDetails"]["videoId"] for i in yt.playlistItems().list(part="contentDetails", playlistId=uploads, maxResults=5).execute()["items"]]
new = [v for v in ids if seen is not None and v not in seen]
report_fetched(len(new))
if not new:
if seen is None:
state.set("seen", ids)
return {"summary": "No new videos"}
for v in yt.videos().list(part="snippet", id=",".join(new)).execute()["items"]:
s = v["snippet"]
out = ai.generate(f"{s['title']}\n\n{s['description']}", system="Improve this YouTube title (max 90 chars), description and 10 tags for search, "
"and write an X post under 240 chars without a link.", json_schema=SCHEMA, max_output_tokens=600).json
log.info("Title changed", {"video": v["id"], "old": s["title"]})
yt.videos().update(part="snippet", body={"id": v["id"], "snippet": {"title": out["title"], "description": out["description"],
"tags": out["tags"], "categoryId": s["categoryId"]}}).execute()
http.post("https://api.x.com/2/tweets", headers={"Authorization": f"Bearer {credentials.connection('x', 'main')}"},
json={"text": f"{out['post'][:250]} https://youtu.be/{v['id']}"}).raise_for_status()
state.set("seen", (seen + new)[-500:])
return {"optimised": len(new)}FAQ
Common questions
Will it change videos I uploaded before it started?
Can I keep my own title?
Does it change thumbnails?
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
Announce each new YouTube video on X
Every time your channel publishes a video, a post written for X goes out with the link, and you get an email copy.
See how it worksLabel new emails automatically
New mail is sorted into labels like Inquiry, Invoice and Newsletter within minutes of arriving.
See how it worksGet draft replies to emails that need an answer
Emails that need a reply get a draft in the same thread, ready for you to edit and send.
See how it worksKeep exploring
Set up “Improve a new video's title and description, then post it on X” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.