Skip to content

BABTUNA/X_better

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

X Followers Search & Export

Chrome extension that adds search, filter, and export functionality to X (Twitter) followers/following pages and search results.

Features

  • Real-time search - Filter followers/following by name, handle, or bio
  • Search post scraping - Collect tweets from any X search results page
  • Auto-scroll loading - Automatically scroll and collect all data, or set a custom limit
  • CSV & JSON export - Export collected followers or tweets as downloadable files
  • API interception - Captures rich data from X's GraphQL API responses (not just what's visible on screen)
  • Dark/light mode - Automatically adapts to X's current theme
  • Badge count - Extension badge shows how many items have been collected

Installation

  1. Clone this repo
  2. Open chrome://extensions in Chrome
  3. Enable Developer mode (top right)
  4. Click Load unpacked and select the project folder

Usage

Followers / Following pages

Navigate to any x.com/{user}/followers, x.com/{user}/following, or x.com/{user}/verified_followers page.

  • Search - Type in the search bar to filter the visible list in real-time
  • Set a limit - Enter a number in the "Max" field to cap how many users to load
  • Load All - Click to auto-scroll and collect all followers/following (or up to your limit)
  • Export CSV / Export JSON - Download collected data as a file

Follower export fields

Field Source
name API / DOM
screen_name API / DOM
description API / DOM
followers_count API
following_count API
verified API / DOM
profile_image_url API / DOM
created_at API

Search pages

Navigate to any x.com/search?q=... page (e.g. search for "YC hackathon").

  • Tweet count - Badge shows how many tweets have been collected
  • Set a limit - Enter a number in the "Max" field to cap how many tweets to load
  • Load All - Click to auto-scroll and collect tweets from search results
  • Export CSV / Export JSON - Download collected tweets as a file

Tweet export fields

Field Source
author_name API / DOM
author_handle API / DOM
text API / DOM
date API / DOM
likes API
retweets API
replies API
quotes API
views API
tweet_url Constructed

Architecture

The extension uses two content scripts communicating via window.postMessage:

Script World Purpose
interceptor.js MAIN Patches fetch/XHR to capture GraphQL follower and search data
content.js ISOLATED UI injection, search, auto-scroll, export, badge updates

MAIN world is needed to intercept network requests on the page's actual window object. ISOLATED world is needed for chrome.* API access and safe DOM manipulation.

File Structure

X_followers/
    manifest.json                 # MV3 manifest
    icons/                        # Extension icons (16, 48, 128px)
    lib/constants.js              # Shared selectors, patterns, timing
    content/
        interceptor.js            # MAIN world - fetch/XHR interception
        content.js                # ISOLATED world - UI, search, export
        styles.css                # Theme-adaptive CSS
    background/
        service-worker.js         # Badge count management

About

X lowkey kinda sucks. Let's fix that.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors