(this is a guided project from boot.dev) gator is a CLI tool for aggregating and reading RSS feeds, built with Go and PostgresSQL.
in summary, the user can use this tool to:
- add RSS feeds from the internet to be collected
- store and collect posts in a PostgresSQL database
- follow and unfollow RSS feeds that other users have added
- view summaries of the aggregated posts, with a link to the full post
make sure you have the following installed before running the program:
install the gator CLI using go install:
go install github.com/potpot1029/gator@latestmake sure your $GOPATH/bin (or $HOME/go/bin) is in your PATH so the binary is accessible:
export PATH=$PATH:$(go env GOPATH)/bingator reads configuration from a file located at ~/.gatorconfig.json.
you need to create the file manually:
touch ~/.gatorconfig.jsonthen add the following content:
{
"db_url": "postgres://<username>:<password>@localhost:5433/<dbname>?sslmode=disable",
"current_user_name": ""
}replace <username>, <password>, and <dbname> with your PostgresSQL credentials.
run the migrations to set up the required tables in your database:
goose postgres "postgres://<username>:<password>@localhost:5432/<dbname>" upgator register <username>and you will automatically login in as the user
gator login <username>(you will need to login to use to below commands)
gator addfeed <feed_name> <feed_url>gator follow <feed_url>gator followinggator agg <time_between_reqs>for example, to starts a continuous fetch loop every 30 seconds:
gator agg 30sgator browser [limit]you can optionally limit the number of posts shown (default is 2)