← Back to blog

A Weekly Social Media Analytics Review Codex Writes for You Every Monday

·AI social media analytics weeklyCodex scheduled tasksTikTok analyticsLinkedIn analyticsAI agent

A Weekly Social Media Analytics Review Codex Writes for You Every Monday

Most creators check their numbers in a burst of anxiety, three dashboards deep, and then close the tabs without changing anything. The data was never the problem. Nobody has a free hour each week to line it up and decide what to do next.

This recipe gives that hour to Codex. Every Monday morning it reads last week’s results from TikTok, YouTube and LinkedIn, writes a short review (what did best, what the winners share, what to try), and updates a plan.md with next week’s posts. It only reads and writes files. It never posts anything, so there is nothing to undo.

By the end you’ll have:

Setup takes about 20 minutes, most of it signing in to your accounts.

Who this fits: someone already posting to two or three of these platforms who has no regular review habit, with a computer that is on and awake on Monday morning. The numbers are read through the accounts signed in on that computer.

What the review can and can’t see

I checked this against the PublishPort command set (publishport-opencli 1.0.40), so the recipe doesn’t promise numbers that aren’t there:

Platform What the AI can read Caveat
TikTok Your TikTok Studio content list: views, likes, comments, saves, shares per video Up to 50 videos per call
YouTube Your channel’s recent videos with their view counts (up to 30) Public numbers only, as shown on the channel page
LinkedIn Your own posts with reactions, comments, reposts and impressions; plus profile views, search appearances and followers Counters as LinkedIn shows them to you

Instagram, X, Threads and Bluesky can be published to but not read back for stats today, so they stay out of this review. If you want them in the plan, tell the AI to include them as “unmeasured” and judge by gut. If you’re curious why platforms differ so much on analytics access, this comparison goes through it.

The recipe

You’ll paste this into Codex in step 2. Replace @YOURHANDLE with your YouTube handle first:

Read https://www.publishport.app/skill.md and follow it to set up PublishPort for me, then check that TikTok, YouTube and LinkedIn are connected, pull my last 7 days of numbers (TikTok Studio video stats, my YouTube channel @YOURHANDLE recent videos, my LinkedIn posts), write reviews/YYYY-MM-DD.md saying which three posts did best and what they have in common, rewrite plan.md for next week, and don't post anything; after that, help me turn it into a scheduled task that runs every Monday at 9 am.

The skill file is a short public instruction sheet: it tells Codex how to sign in, see which accounts your computer has connected, and run reads. Authorization is one click from you, and every AI you’ve authorized is listed on your account page, where you can revoke it.

Step 0: Get three things ready

1. The ChatGPT desktop app (Codex lives inside it). Install it from OpenAI’s download page and sign in. Per OpenAI’s docs, the Codex CLI and IDE extension have no Scheduled interface, so use the desktop app (or the web) to create the task.

2. The PublishPort desktop app, signed in. Install it from the download page, open Platform accounts, click Sign in on TikTok, YouTube and LinkedIn, sign in as you normally would in the window that opens, then click I’ve signed in (walkthrough).

3. Node.js and a folder. Publishing and reading commands run on Node.js; ask Codex to run node -v, or install the LTS release from nodejs.org. Then create a folder called weekly with a plan.md containing your current intentions, even rough ones:

Goal: more sign-ups from short videos
Cadence: 4 TikTok/YouTube clips a week, 2 LinkedIn posts
Topics I'm considering: pricing teardown, behind-the-scenes, a customer question

The AI uses the goal to judge what “did well” means. A video with few views and many saves can be a win for one goal and a miss for another.

Step 1: Open the folder in Codex

In the ChatGPT desktop app, switch to Codex and open weekly as your workspace. It doesn’t need to be a Git repository; in non-version-controlled projects, OpenAI’s docs say scheduled tasks run directly in the project directory.

Step 2: Paste the recipe and watch one review

Send the recipe. Here’s what happens:

  1. Codex installs the PublishPort skill and gives you an authorization link and a confirmation code. Open the link, sign in or create a PublishPort account, check the code matches, click Authorize. The link lasts 10 minutes.
  2. It reports which of your three accounts are signed in. If one is missing, sign in again under Platform accounts and ask it to re-check.
  3. It pulls the numbers, writes reviews/<today>.md, and rewrites plan.md.
  4. It offers to create the Monday task. Say yes.

Read the first review critically. Is it comparing like with like (a Short against a Short, not against a long video)? Does it say where a number is missing? Tell it what you want changed (“compare against my last four weeks, not just last week”) and it will carry that into the saved task.

Step 3: Let the task reach the network (once)

Scheduled tasks run unattended with the default sandbox, and the default blocks network access, which every read needs (OpenAI docs). The fix is a rule that allows one command prefix. Send this in the same chat and approve what it asks:

Install the publishport CLI globally with npm, then add a rule to ~/.codex/rules/default.rules that allows commands starting with "publishport" to run outside the sandbox. Tell me when to restart the app.

Or do it by hand: run npm install -g publishport, add this to .codex/rules/default.rules in your home folder, then restart the ChatGPT app:

prefix_rule(
    pattern = ["publishport"],
    decision = "allow",
    justification = "PublishPort reads need network access",
)

Only commands starting with publishport run outside the sandbox.

Step 4: Check the Monday task

Open Scheduled in the sidebar. You should see a weekly Monday 9 am task on the weekly folder. If not, create a standalone task there, pick the folder, set it to weekly on Monday at 9 am, and paste:

This is a pre-approved weekly review. Read-only: do not publish, comment or reply anywhere.

1. Read plan.md for my goal. Read the last two files in reviews/ so you can compare.
2. Using publishport (check publishport guide <platform> for the exact read commands), get: TikTok Studio video stats, recent videos from the YouTube channel @YOURHANDLE, and my recent LinkedIn posts with their analytics.
3. Keep only items posted in the last 7 days. If a platform fails, say so in the review and carry on with the others. Never guess a number.
4. Write reviews/<today's date>.md: a table of what was posted and its numbers; the top three posts and what they share (topic, length, hook, time of day); anything that underperformed; the change since last week's review.
5. Rewrite plan.md for the coming week: keep my goal and cadence, list the posts to make with a topic and an angle each, and say which one idea to repeat and which to drop.

OpenAI recommends testing a prompt by hand before scheduling and reviewing the first few runs, which is what step 2 did. Since it’s read-only, a bad run costs you a poor review, not a poor post.

Make it feed the posting recipe

Once the review is trustworthy, plan.md becomes the input for your posting. The Codex video-queue recipe picks the next clip each evening; the Claude Code daily post recipe reads dated topic lines. Point either at the topics in plan.md and the loop closes: post, measure, plan, post.

If something doesn’t run

The free plan covers setting all of this up; plan limits and pricing are on the pricing page.