A CLI tool to aggregate RSS feeds and browse blog posts like it's 2005 (but with modern TypeScript, because we're not animals).
Before you can start hoarding blog posts, make sure you have:
- Node.js - The JavaScript runtime (because browsers are for peasants)
- PostgreSQL - A database to store all those feeds (yes, you need to set one up yourself)
- npm - To install dependencies (obviously)
npm installThis installs all the packages. If it fails, check your internet connection and/or your life choices.
Create a file called .gatorconfig.json in your home directory (~/.gatorconfig.json). It should look like this:
{
"db_url": "postgresql://username:password@localhost:5432/database_name",
"current_user_name": ""
}Important notes:
- Replace
username,password,localhost,5432, anddatabase_namewith your actual PostgreSQL credentials - Leave
current_user_nameempty for now - you'll set it when you register/login - If you mess this up, the CLI will yell at you (politely, with error messages)
Run the migrations to create all the tables:
npm run migrateIf this fails, check that your PostgreSQL is running and your db_url is correct. The database won't create itself (we're not wizards).
Run commands like this:
npm start <command> [args...]Or if you're feeling fancy:
tsx ./src/index.ts <command> [args...]register <name> - Create a new user account
npm start register aliceCreates a user and automatically logs you in. No password needed (we're living dangerously).
login <name> - Switch to an existing user
npm start login bobSwitches your session to another user. The config file remembers who you are.
users - List all registered users
npm start usersSee who else is using this thing (spoiler: probably just you).
addfeed <feed_name> <url> - Add a new RSS feed
npm start addfeed "Tech Blog" https://example.com/feed.xmlCreates a feed and automatically follows it. Convenient!
feeds - List all feeds in the system
npm start feedsSee what feeds exist (even ones you didn't create).
follow <feed_url> - Follow an existing feed
npm start follow https://example.com/feed.xmlStart following a feed that someone else added.
following - List feeds you're following
npm start followingSee what feeds you're subscribed to.
unfollow <feed_url> - Unfollow a feed
npm start unfollow https://example.com/feed.xmlBreak up with a feed. It's not you, it's them.
agg <time_between_reqs> - Start aggregating feeds periodically
npm start agg 1h 30mRuns continuously, fetching feeds at the specified interval. Supports formats like:
1h 30m 15s(human readable)3500ms(milliseconds, for robots)
Press Ctrl+C to stop. It will gracefully shut down (unlike some programs we know).
browse [limit] - Browse posts from feeds you follow
npm start browse 10Shows posts from feeds you're following. Default limit is 2 if you don't specify (we're trying to save your screen space).
reset - Reset the database (nuclear option)
npm start reset# 1. Set up your config file (~/.gatorconfig.json)
# 2. Run migrations
npm run migrate
# 3. Register a user
npm start register myname
# 4. Add a feed
npm start addfeed "Hacker News" https://hnrss.org/frontpage
# 5. Start aggregating (in one terminal)
npm start agg 5m
# 6. Browse posts (in another terminal)
npm start browse 5- Commands marked with
⚠️ Requires login need you to be logged in first (useregisterorlogin) - The config file stores your current user session, so you don't need to log in every time
- Run
aggin the background or a separate terminal - it runs forever until you stop it - If something breaks, check your database connection and config file format
Happy feed aggregating! 🐊