Skip to content

cvrs3d/blog-aggregator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gator Blog Aggregator

gator is a small CLI that lets you register users, follow RSS feeds, and periodically scrape new posts into Postgres.

Prerequisites

  • Go 1.25+ (used to build and install the CLI). Install from https://go.dev/dl or via a package manager (brew install go, choco install golang, etc.).
  • PostgreSQL 14+ running locally and reachable via a connection string. Any installation method works (brew install postgresql, Linux packages, Windows installer, Docker, …) as long as you can create a database for the app.

Install the CLI

go install github.com/cvrs3d/blog-aggregator@latest

The binary is installed to $(go env GOPATH)/bin (or $GOBIN if set). Make sure that directory is on your PATH so you can invoke gator from any shell.

Configure Postgres access

gator expects a JSON config file in your home directory named ~/.gatorconfig.json. Create it with the database URL you want the CLI to use:

{
  "db_url": "postgres://postgres:postgres@localhost:5432/blog_aggregator?sslmode=disable",
  "current_user_name": ""
}
  • db_url must be a valid Postgres connection string with a database that already exists.
  • current_user_name is managed by the CLI when you run gator register or gator login, so you can leave it empty on first setup.

Running the program

Once the config file exists and Postgres is reachable, run any command by calling the gator binary followed by the command name. A typical workflow looks like:

# Create a user and make it the active session in the config file
gator register alice

# (or) mark an existing user as active
gator login alice

# Add a feed you want Alice to follow
gator addfeed "My Blog" https://example.com/feed.xml

# Follow feeds created by other users by URL
gator follow https://friend.example.com/rss

# See which feeds the active user follows
gator following

# Pull posts continuously (runs until you stop it)
gator agg

# Browse the latest posts for the active user (defaults to 2, supplying a number changes the limit)
gator browse 5

Other useful commands:

  • gator users – list every user and highlight the one currently stored in the config file.
  • gator feeds – list all feeds plus the user who created each one.
  • gator unfollow <feed-url> – stop following a feed.
  • gator reset – drop all users and feeds (destructive; for local development only).

If a command reports it cannot connect to Postgres, double-check that db_url matches your running instance. If you installed the CLI with go install but the shell cannot find gator, export PATH=$(go env GOPATH)/bin:$PATH in your shell profile.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages