← Back to blog

Pinterest on Autopilot: Claude Code Pins Every New Blog Post to the Right Board Each Morning

·how to automate pinterest pinningPinterest automationClaude Code scheduled tasksauto pin blog postsAI agent

Pinterest on Autopilot: Claude Code Pins Every New Blog Post to the Right Board Each Morning

Publishing a blog post takes an afternoon. Pinning it takes another twenty minutes you rarely have: pick a board, rewrite the title for a search box instead of a headline, write a description, attach the cover image, set the link. So most posts never get a pin at all, and on Pinterest, which works more like a search engine than a feed, a pin is how a post keeps being found for months.

This recipe hands that twenty minutes to Claude Code. Every morning a scheduled task looks at your blog, and for each post published in the last day it writes a pin title and description, chooses the board that fits, and publishes the pin with your post’s own cover image and a link back to it. When you’re done you’ll have:

It takes about 20 minutes, most of it signing in and filling in one environment form.

Who this fits: a blogger or small shop with a blog that has an RSS or Atom feed (WordPress, Ghost, Substack, Shopify and most static site generators have one), a Pinterest account, and a home or office computer that is on at pinning time. The AI runs in Anthropic’s cloud; the pins are published from your own computer through your own Pinterest login.

What this does and doesn’t do

I checked this against the PublishPort command set (publishport-opencli 1.0.40):

Pinterest action Available
List your boards Yes
Create a pin with a title, description, destination link and image from a URL, on a named board Yes
Create a board Yes
Schedule a pin in Pinterest for later No. The task is scheduled, so the pin goes out when the task runs
Read pin stats back No

Pinterest has its own native scheduler and bulk upload. If your pins are ready-made images that you design in a batch, those are enough. This recipe is for the other case: you have posts and no time to turn each one into a pin. For a longer comparison, see how to automate Pin scheduling without losing board strategy.

One thing to keep honest: the recipe uses each post’s existing cover image. Pinterest favours tall images, and a wide 1200×630 social card works but won’t be the best pin. If you have a tall version of each cover, say so in pinning-rules.md and tell the AI where to find it.

The recipe

You’ll paste this to Claude Code in step 3. Replace https://YOURBLOG.com/feed.xml with your own feed address first:

Read https://www.publishport.app/skill.md and follow it to set up PublishPort for me, then check that Pinterest is connected and list my boards; read the feed at https://YOURBLOG.com/feed.xml, take the newest post, use its cover image, write a pin title and description in the voice described in pinning-rules.md, choose the board that fits using the rules in that file, show me the pin, and once I approve, publish it and give me the link. After that, help me turn it into a daily scheduled task that pins any post published in the last 24 hours.

The skill file is a short public instruction sheet. It tells the AI how to sign in, check which accounts your computer has connected, publish, and confirm the result. Authorization is one click from you, and every AI you’ve authorized is listed on your account page, where you can revoke it at any time.

Step 0: Get four things ready

1. The PublishPort desktop app, signed in to Pinterest. Install it from the download page, open Platform accounts, click Sign in next to Pinterest, sign in the way you normally would in the window that opens, then click I’ve signed in (walkthrough). Pins come from your real session, as if you’d made them by hand.

2. Claude Code on a plan with scheduled tasks. Per Anthropic’s docs, scheduled tasks are available on Pro, Max, Team and Enterprise, currently as a research preview. For the first test run, use any surface: the CLI, the desktop app or claude.ai/code. Node.js must be on the machine where you run the test; check with node -v or install the LTS release from nodejs.org.

3. Your feed address. Open yourblog.com/feed, /feed.xml, /rss.xml or /atom.xml in a browser. One of them shows a page of XML. That’s it. Note it down.

4. A GitHub repo with pinning-rules.md. Scheduled tasks are built around repositories: every run clones the ones you pick. Create a private repo (call it my-pinning) with this file, edited to fit you:

Voice: practical and friendly, second person, no hype, no emoji.

Pin title: describe what the reader gets, in words someone would type into Pinterest search. Under 100 characters.
Pin description: two or three sentences, include the main search phrase once, end with what the reader will learn. Under 500 characters. No hashtag lists.

Boards:
- "Weeknight Dinners": quick recipes, under 45 minutes
- "Meal Prep": batch cooking, freezer meals, lunch boxes
- "Budget Cooking": anything about saving money on food
If a post fits none of these, don't pin it and say so.

Use your own boards and your own wording. The board list matters most: it’s the board-strategy half of the job, and it’s why the AI doesn’t pin everything to one board. Use the exact board names as they appear on your profile.

Step 1: Do a supervised first run

Open a Claude Code session in a clone of your repo and paste the recipe. What happens:

  1. Claude reads the skill, installs it and runs the login. It 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; ask for a new one if it expires.
  2. It checks your computer and reports whether Pinterest is signed in, then lists your boards. If a board name in your rules doesn’t match one in the list, it tells you.
  3. It reads your feed, takes the newest post, finds its cover image, and shows you a pin: the title, description, board and destination link.
  4. Edit freely (“shorter title”, “put it on Meal Prep instead”), then say “post it”. It publishes and hands you the pin link, which you should open and look at.

Do this by hand at least once. PublishPort’s instructions tell the AI to show you the content before the first publish in a session, so this is the run where you tune your pinning-rules.md. Every correction you make here is a sentence worth adding to the file.

Step 2: Give the cloud session its credential

The login in step 1 saved your credential on the machine where you ran it (~/.publishport/config.json). A cloud run starts on a fresh machine and never sees that file, so PublishPort’s instructions for throwaway sandboxes say to pass the credential through the environment. In Claude Code that means a cloud environment, the settings bundle a scheduled task runs in (Anthropic docs).

  1. In the PublishPort app, open Connect AI, expand Use MCP instead, and click Generate address. The address contains your credential.

  2. At claude.ai/code, create a new environment (or edit the one you’ll use for this task) and add one environment variable, in KEY=value form:

    PUBLISHPORT_MCP_URL=<the address you copied>
  3. Set Network access to Custom, tick Also include default list of common package managers, and under Allowed domains add two lines: api.publishport.app and your blog’s domain (for example yourblog.com). The default Trusted level only reaches an allowlist of package registries and developer sites, so without these the publish call and the feed fetch are both blocked (network access docs). Keeping the default list on matters because npx fetches the PublishPort CLI from npm.

Two cautions from the same docs. Environment variables are visible to anyone who can use the environment, so make a separate one for this task. And the address can run commands on your computer: treat it like a password, never commit it, and if it leaks, revoke the AI under AI access on your account page and generate a new one.

Step 3: Create the scheduled task

Go to claude.ai/code/routines and click New task. (If a menu opens first, choose Set up manually; Create with Claude works too if you’d rather describe the task in chat. From the CLI, /schedule daily pinning at 8am starts the same flow.) Fill in:

This is a pre-approved daily publishing task. Publish without asking me to confirm.

1. Read pinning-rules.md for voice and boards.
2. Fetch the feed at https://YOURBLOG.com/feed.xml. Select only posts published in the last 24 hours. If there are none, stop and say "nothing new".
3. For each such post: open its page and take the cover image URL (the og:image tag). Write a pin title and description following the rules. Choose a board from the rules; if none fits, skip the post and say why. Use the post's own URL as the destination link.
4. Publish through PublishPort: first run `publishport guide pinterest` to read the live options, then create the pin on the chosen board with the image URL, title, description and link. One pin per post.
5. If a command errors or times out, don't re-run it. List the board first and check the pin isn't already there; retry once only if it isn't. If it still fails, skip that post and say why.
6. End with a summary: post title, board, pin link, or the reason it was skipped.

Nobody is watching at 8 am, so the prompt says what’s pre-approved. One limit to know: Anthropic’s docs say a saved prompt isn’t live user input and can’t act as consent for actions during a run. If Claude holds back on the first scheduled runs and asks for confirmation, that’s its safeguard working. Read those sessions, tighten the wording or your rules file, and don’t try to argue it out of the check. Also note that scheduled tasks run without stopping for permission approvals and use every connector you leave on, so on the Connectors tab remove any the task doesn’t need.

Click Create, then Run now on the task’s page. If you published nothing in the last 24 hours the run will correctly say “nothing new”; for a real test, temporarily change “24 hours” to “7 days” and set it back afterwards. Each run is its own session you can open and read.

When it doesn’t work

Make it yours

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