Adding Dopamine to my Blog

Published on 2025-11-17

Adding TikTok to My Blog (and Testing Cursor)

Inspired by Chad Ide (https://www.cladlabs.ai/), "The first brainrot code editor", I realized my blog was pretty… boring. So yeah, it clearly needed some extra dopamine. And obviously, the king of short-form dopamine is TikTok, so I decided to integrate TikToks into my blog.

First, I also wanted to use this as an excuse to test Cursor. The last couple of months I've been messing with ChatGPT Codex-style workflows and loved it, so giving Cursor a try felt natural. I downloaded it, imported my VSCode configs, and yeah — at first sight it's basically VSCode with an agent window slapped on top.

Planning the whole thing

Before writing any code, I needed a plan. And since I didn't want to burn Cursor's free tokens on early drafts, I went to my day-one teammate: ChatGPT. Basically, there were only two ways to integrate TikTok:

  • A) Using TikTok's embed function — take a post URL, embed it, done.
  • B) Using the TikTok API — create a dev app, get API keys, do OAuth, etc.

Of course, I picked the fun one: the API route.

Building the first prototype

My initial idea was to add an endless auto-scroll section of TikToks on the side of this post. So I opened the Cursor agent window and asked for a first draft component. I told it to generate a lorem ipsum post and drop the component beside it. After a couple of visual fixes — the first version rendered as a giant full-screen overlay — it looked exactly how I imagined it.

Applying for the TikTok API

I went straight into the "TikTok for Developers" site and followed the obvious buttons until I reached the create application form. Gotta say: TikTok's dev portal is one of the cleanest and friendliest I've ever used. Took like 1 minute from Google → create app screen.

You just upload a logo (mine was GPT-generated), add a description, validate domain, pick API products and scopes… and you're set for review.

One super nice feature is their sandboxes — they let you test almost everything on the API with dev accounts. So I created a separate TikTok account, added it to my sandbox, and I was ready to go.

OAuth: the fun part (kinda)

TikTok uses OAuth, so I needed a backend. My goal: add a "Log in with TikTok" button and then let the user see something like their "For You" page. So I generated the backend with GPT-5.1 (saving Cursor tokens for the frontend).

Backend pieces:

  • an auth endpoint
  • a callback URL to catch the login
  • 3 endpoints:
    • get user info
    • check login/session/token status
    • get user videos

After some confusion between my local .env redirect URL and the TikTok sandbox redirect URL, the login worked. I clicked "Allow" and got in.

And then… the big disappointment

I checked user info → worked. I checked the token → present. Then I hit the /videos endpoint — the one I wanted for my endless brainrot carousel — and it returned… nothing.

Turns out: TikTok does NOT provide access to a user's "For You" feed. Not even a public feed. The videos endpoint only returns the user's own uploaded TikToks. And since I had none… yeah. My infinite feed would be an infinite loop of zero videos.

So yeah — API plan dead. Time to go with plan B.

Scraping mode activated

Since the embed version worked nicely in my first demo, I figured I could scrape a bunch of TikTok URLs from popular hashtags and rotate them randomly.

I wrote a quick Puppeteer script to load TikTok pages and extract video URLs. Headless mode didn't work — I only got the pre-hydration HTML with no TikToks — so I moved to real browser mode.

After fighting a couple of anti-bot protections and switching to mobile layout (the softer one), I managed to gather ~100 TikToks. I could've scraped more, but since I'm not really a TikTok user, I had zero idea which hashtags to go after. Still, good enough for my carousel.

Dumped the URLs into a CSV, saved it into my repo, and that was it — I had a working "infinite feed" (well, infinite-ish).

Final thoughts

Even though my original idea wasn't possible (at least not with the current TikTok API), I still had fun integrating a "Log in with TikTok" button for the first time ever and building the whole flow. And I ended up emulating the feature I wanted anyway, just using scraped URLs instead of a real feed. So I'll call it a draw and move on.

My first Cursor impressions

I don't know which model they're using under the hood for the free plan, but results were solid and the agent tooling works exactly how I hoped. I still need to mess around with it more before deciding if I'll fully switch (and pay yet another $20/mo subscription). But being honest… it looks very likely I'll migrate.