gator CLI is a commandline tool for aggregating posts from a list of RSS feeds, and allowing users to follow different feeds and browse the latest posts.
Ensure you have the following installed on your system:
- Go (version 1.20 or later)
- PostgreSQL (version 17)
git clone https://github.com/joelsearcy/gator.git
cd gatorRun the following command to install Go dependencies:
go mod tidyFollow the PostgreSQL installation guide for your operating system. Ensure PostgreSQL v17 is installed and running.
-
Create a new PostgreSQL database:
CREATE DATABASE gator;
-
Create
~/.gatorconfig.jsonin your home directory, and update the PostgreSQL connection string with your username:{"db_url":"postgres://<your_username>:@localhost:5432/gator?sslmode=disable"}
Install gator CLI on the command line from the gator repository directory:
go installStart the application using:
gator <command> [<args>]| Command Name | Arguments | Description |
|---|---|---|
register |
username | Registers a new user with gator. |
login |
username | Switches the current user to the specified user. |
users |
None | Lists all of the registered users. |
addfeed |
Feed name, URL | Adds a new RSS feed for aggregation, and adds the current user as a follower. |
follow |
Feed URL | Adds the current user as a follower of the RSS feed. The RSS feed must already have been added. |
unfollow |
Feed URL | Removes the current user as a follower of the specified RSS feed. |
following |
Feed URL | Lists the RSS feeds that the current user is following. |
agg |
time between requests | Scrapes the oldest last fetched RSS feed for new posts every [time between requests]. This is a background process that needs to run to aggregate new posts from the RSS feeds. |
browse |
[number of posts] | Lists the n most recent posts for the current user. n defaults to 2. |