A Tampermonkey userscript that automatically tracks visited X/Twitter posts with frecency-based scoring for easy retrieval.
Posts you've seen on X but didn't Like or Bookmark are nearly impossible to find later. Searching by vague memory is painful.
This script silently records every status page you visit, storing the URL and a title summary (from og:title meta tag) in localStorage. Entries are ranked by frecency -- a combination of visit frequency and recency -- so the posts you visit often and recently always float to the top.
- Automatic tracking -- Detects SPA navigation via
pushState/replaceStateinterception. No manual action required. - Frecency ranking -- Inspired by z (jump) / autojump. Score =
visits * 2^(-age / half_life). Recent + frequent = highest rank. - Deduplication -- URLs are normalized to
https://x.com/{user}/status/{id}. Revisits increment the counter and refresh the title. - Title extraction -- Reads
<meta property="og:title">with retry logic (up to 6 attempts, 1s apart) to handle SPA async updates. - Browsable history panel -- Search/filter by title or URL, sorted by frecency score. Click to open, hover to delete.
- Configurable settings -- Max entries cap and frecency half-life, adjustable via the Settings tab.
- Export -- One-click JSON export of all tracked entries with scores.
- Danger zone -- Clear all history with two-step inline confirmation.
- Install Tampermonkey
- Create a new script and paste the contents of
user.js - Visit any post on x.com -- tracking starts automatically
Tampermonkey menu > View History
Opens a panel with two tabs:
History tab
- Search bar to filter by title or URL
- Entries sorted by frecency score (shown on the left)
- Click an entry to open in a new tab
- Hover to reveal the delete button
- Export button to download as JSON
Settings tab
- Max entries -- Slider (50-1000) or manual input (10-5000). Lowest-frecency entries are evicted when exceeded.
- Frecency half-life -- Slider (1-30 days). Lower values make recent visits dominate. Higher values let older entries persist.
- Danger Zone -- Clear all history with two-step confirmation.
Changes take effect after clicking Save Settings.
Tampermonkey menu > Export History (JSON) for quick export without opening the panel.
score = visits * 2^(-age / half_life)
| Scenario | visits | age | half_life=7d | score |
|---|---|---|---|---|
| Visited once, just now | 1 | 0 | 7d | 1.0 |
| Visited 5 times, 1 day ago | 5 | 1d | 7d | 4.5 |
| Visited 10 times, 14 days ago | 10 | 14d | 7d | 2.5 |
| Visited once, 30 days ago | 1 | 30d | 7d | 0.05 |
Posts you visit frequently and recently rank highest. Old, rarely-visited posts naturally sink and get evicted when the cap is reached.
- History data --
localStoragekeyx-history-tracker(stays within x.com origin) - Settings --
GM_setValuekeyx-history-tracker-settings(persisted by Tampermonkey)
MIT