1.4.1 • Published 9 months ago
@johnlindquist/twi v1.4.1
TweetIngest CLI
A CLI tool to scrape and gather tweets from a Twitter (X) user's timeline (without the official API).
Installation
pnpm install -g @johnlindquist/twiUsage
twi [options] <username>Examples
# Scrape 50 tweets from Elon
twi johnlindquist
# Scrape up to 150 tweets, no editor
twi johnlindquist --max-tweets 150 --no-editor
# Print everything to console (still saves file)
twi johnlindquist --pipeOptions
--max-tweets, -m: Maximum number of tweets to scrape (default 50).--debug: Log verbose debug information.--pipe, -p: Print final output to stdout.--no-editor, -n: Save results but do not open in default editor.--clipboard, -y: Copy output to the clipboard.
Disclaimer
This script uses Puppeteer to load Twitter's web interface and scroll the timeline. It may break if Twitter changes. For large accounts with thousands of tweets, you may need repeated runs or an official API solution.
Development
# Install deps
pnpm install
# Start in dev mode
pnpm dev -- your_username
# Build
pnpm build
# Link CLI
pnpm link --global
twi your_usernameMIT License