Okey, I got it myself!
So I made a Custom extension bot, that works at X.
I don't want to give any download link to this, because you can vibe code this yourself using https://claude.ai/
You can add your own features to it if you want!
I just needed that
like feature thing only, because I don't want to check the feed, because it takes time from other things.
And I don´t get anything done.
Here is the prompt I used so you get the same extension Bot:
Build a Chrome extension called "X Keyword Liker" that automatically likes posts on X (Twitter) based on a keyword search. Here's exactly how it should work:
Core behaviour:
- The user types a keyword into the popup UI and presses a Play button
- When Play is pressed, the extension opens a new tab with https://x.com/search?q=<keyword>&f=live
- It then scans visible posts on that page every ~8 seconds, and clicks the like button on any post whose text contains the keyword
- If no matching post is found, it scrolls down to load more posts
- Already-liked posts (where the like button has data-testid="unlike") are skipped
- The session runs for exactly 5 minutes, then stops automatically
- The user can also stop the session early with a Stop button
- Maximum 5 likes per day (resets at midnight). The daily count persists in chrome.storage.local
- When the session ends, the search tab is closed automatically
UI (popup.html + popup.js):
- Dark terminal/cyberpunk aesthetic using JetBrains Mono and Syne fonts
- Keyword text input field (disabled during active session)
- Play/Stop button that toggles state
- Live countdown timer showing time remaining in the session
- A shrinking progress bar for the session duration
- 5 heart "pip" icons that fill up as daily likes are consumed
- Quota counter in the header showing how many likes remain today
- Animated status dot (pulsing green when running, grey when idle)
- Activity log showing timestamped entries for every like, scroll, session start/stop
- Error banner for messages like "daily limit reached" or "no keyword entered"
Files needed:
- manifest.json — Manifest V3, permissions: storage, scripting, tabs, activeTab, host permissions for x.com and twitter.com
- background.js — Service worker managing session state, tab lifecycle, the like-tick loop, and daily count tracking in chrome.storage.local
- content.js — Minimal sentinel script injected into X pages
- popup.html + popup.js — The UI described above
- icons/icon48.png and icons/icon128.png
Architecture:
- Session state lives in the background service worker (survives popup close)
- The background worker uses chrome.scripting.executeScript to inject a findAndLike() function into the X tab
- findAndLike() queries article elements, checks [data-testid="tweetText"] for the keyword, clicks [data-testid="like"], and returns a result object { liked, postId, snippet } or { scrolled: true }
- The popup communicates with the background via chrome.runtime.sendMessage with actions: getState, startSession, stopSession
- The background pushes state updates to the popup via chrome.runtime.sendMessage({ action: "stateUpdate" })
- A like-tick runs every 8 seconds via setTimeout chain, checks daily limit, injects the script, increments count on success
|