analytics-insights
Analytics & Insights
Browser console scripts for analyzing X/Twitter performance — no API key needed. All analysis runs in DevTools console.
Script Selection
| Goal | File | Navigate to |
|---|---|---|
| Engagement metrics | src/engagementAnalytics.js |
x.com/USERNAME |
| Best posting times | src/bestTimeToPost.js |
x.com/USERNAME |
| Hashtag analysis | src/hashtagAnalytics.js |
x.com/search?q=%23tag |
| Competitor comparison | src/competitorAnalysis.js |
Any page |
| Follower audit (fake/bot) | src/auditFollowers.js |
x.com/USERNAME/followers |
| Sentiment analysis | src/sentimentAnalyzer.js |
Any timeline |
| Tweet performance ranking | src/tweetPerformance.js |
x.com/USERNAME |
| Viral tweet detection | src/viralTweetDetector.js |
x.com/USERNAME |
| Posting schedule optimizer | src/tweetScheduleOptimizer.js |
x.com/USERNAME |
| Follower demographics | src/audienceDemographics.js |
x.com/USERNAME/followers |
| Follower growth tracking | src/followerGrowthTracker.js |
x.com/USERNAME/followers |
| Content calendar analysis | src/contentCalendar.js |
x.com/USERNAME |
| Engagement leaderboard | src/engagementLeaderboard.js |
x.com/USERNAME |
| Tweet A/B testing | src/tweetABTester.js |
x.com/USERNAME |
| Follow ratio management | src/followRatioManager.js |
x.com/USERNAME |
| Audience overlap analysis | src/audienceOverlap.js |
x.com/ACCOUNT/followers |
| Account health scoring | src/accountHealthMonitor.js |
x.com/USERNAME |
| Shadowban detection | src/shadowbanChecker.js |
x.com/USERNAME |
Quick Start
- Navigate to the required page on x.com
- Open DevTools (F12) → Console
- Paste the script → Enter
- Results display in console + auto-export as JSON
Script Details
engagementAnalytics.js
Scrapes your timeline and calculates per-tweet engagement rates (likes + RTs + replies / views). Shows average, median, best/worst performers, and engagement trend over time.
sentimentAnalyzer.js
Lexicon-based sentiment analysis on any timeline. Classifies tweets as positive/negative/neutral. Shows sentiment distribution chart, most positive/negative tweets, and keyword frequency.
tweetPerformance.js
Side-by-side tweet comparison with multi-metric ranking. Sorts by likes, RTs, replies, views, or composite engagement rate. Identifies content patterns that drive performance.
viralTweetDetector.js
Multi-factor viral scoring: engagement velocity, like-to-RT ratio, reply depth, view multiplier. Flags tweets significantly exceeding your baseline. Useful for identifying what resonates.
tweetScheduleOptimizer.js
Analyzes your posting history to build a personalized optimal schedule. Generates heatmaps of engagement by day/hour. Recommends best slots based on YOUR audience's behavior.
audienceDemographics.js
Scrapes follower profiles and classifies by niche (tech, marketing, crypto, etc.), account size, bot likelihood, and verified status. Visual distribution charts.
engagementLeaderboard.js
Ranks users who engage most with your content. Identifies superfans (5+ interactions), regulars, and casual engagers. Exports VIP list for relationship building.
Controls: Auto-run on paste. XActions.pause() / XActions.abort() available.
tweetABTester.js
Create controlled tests between two tweet variations. Post both, track metrics over time, get statistical winner determination with percentage difference.
Controls: XActions.createTest(), XActions.measure(), XActions.results()
followRatioManager.js
Monitors follower/following ratio with letter grades (S→F). Generates 3 improvement paths (unfollow more, gain followers, combination). Tracks ratio history over time.
Controls: XActions.track(), XActions.plan(), XActions.history()
audienceOverlap.js
Compare follower lists between two accounts to find shared followers, unique audiences, and Jaccard similarity. Useful for collaboration decisions and competitor analysis.
Controls: XActions.analyze('accountA', 'accountB')
Strategy Guide
Weekly analytics routine
- Run
src/tweetPerformance.js— identify this week's top content - Run
src/tweetScheduleOptimizer.js— verify you're posting at optimal times - Run
src/followRatioManager.js→XActions.track()— log weekly ratio - Run
src/engagementLeaderboard.js— identify top engagers to nurture
Diagnosing a growth stall
src/accountHealthMonitor.js— check overall account health scoresrc/shadowbanChecker.js— rule out shadowbansrc/audienceDemographics.js— verify you're attracting the right audiencesrc/viralTweetDetector.js— check if you've had any breakout content recentlysrc/competitorAnalysis.js— compare your metrics to peers
Preparing for a content pivot
src/sentimentAnalyzer.js— understand current audience sentimentsrc/tweetPerformance.js— identify what content types worksrc/audienceOverlap.js— compare your audience with target niche leaderssrc/contentCalendar.js— find posting gaps to fill
Notes
- All scripts auto-export results as downloadable JSON
- Accuracy improves with more data — increase
maxPostsin CONFIG for deeper analysis - Engagement rates: (likes + retweets + replies) / views
- Scripts only analyze visible browser data — increase scroll rounds for more data
- localStorage used for historical tracking (growth, A/B tests, ratio history)
More from nirholas/xactions
twitter-scraping
Scrapes X/Twitter data without API access using Puppeteer stealth and browser console scripts. Extracts profiles, followers, following lists, tweets, search results, hashtags, threads, media, bookmarks, notifications, DMs, likes, and viral tweets. Exports to JSON/CSV. Use when collecting, exporting, or analyzing Twitter data.
25direct-messages
Sends, manages, and automates direct messages on X/Twitter. Supports personalized bulk DMs with templates, conversation management, message request filtering, and DM export. The agent uses this skill when a user needs to send DMs, manage conversations, or automate direct messaging workflows.
10growth-automation
Automates X/Twitter growth via browser console scripts. Auto-likes tweets by keyword/user filters, auto-comments on target users, follows by keyword search or engagement, follows audiences of target accounts with rich filtering, trains the algorithm for niches, and runs combined growth suites. All require pasting core.js first. Use when automating Twitter growth, engagement, following, or audience building.
10engagement-interaction
Automates X/Twitter engagement actions — like, unlike, reply, bookmark, hide replies, and auto-like by keyword. Also bulk-unlikes all posts. Use when users want to automate likes, send replies, manage bookmarks on tweets, hide replies, or clear their entire likes history.
10follower-monitoring
Monitors X/Twitter follower changes using browser console scripts. Detects who unfollowed, tracks new followers with welcome messages, monitors any public account, runs continuous monitoring with alerts, tracks follower growth over time, and analyzes follower demographics. Use when tracking follower changes, detecting unfollowers, or monitoring Twitter accounts.
9grok-ai
Integrates with X/Twitter's Grok AI for chat, image generation, tweet analysis, and content creation. Automates Grok prompts, scrapes Grok responses, and uses Grok for content strategy. Requires X Premium+. Use when users want to use Grok AI for content generation, analysis, or chat automation on X.
8