Gator is a blog aggregator CLI app that let you follow, store locally and read rss feeds.
git clone https://github.com/niccolot/Gator
cd Gator
Install dependencies with
cd scripts
chmod +x install_dependencies.sh
./install_dependencies.sh
And set the database url in the .env
file by running
cd scripts
chmod +x create_env_vars.sh
./create_env_vars.sh
cd ..
source .env
The database is implemented using postgres with Go code generated by sqlc and the database migrations handled by goose.
Run in the terminal
sudo -u postgres psql
Then create the sql database
CREATE DATABASE gator;
\c gator
ALTER USER postgres PASSWORD 'postgres';
In order to build and start the application one can use the provided script
cd scripts
chmod +x start.sh
./start.sh
Or in alternative
go install github.com/niccolot/[email protected]
(make sure you have properly set up the Go environment):
export PATH=$(go env GOPATH)/bin:$PATH
By starting the applicatio you are prompted by the CLI interface
Gator >
-
The
help
command will list all the avalable commands -
The usual workflow is: registering as user, adding some feeds to the database, starting the aggregation and browsing the latest feeds, eventually bookmarking or opening your favourite posts.
The app is usable by different users. By default the first to register is set as superuser which as some privileges such as resetting the database and changing user's passwords.
Different users can be registered and logged in with the login <username>
.
In order to follow a feed one has to save it in the database with the addfeed <feed url>
command. Other users can follow feeds already saved in the database with the follow <feed url>
command.
By running the aggregate <time between updates> [optional] -log
a background goroutine is called to fetch all the feeds concurrently and update the posts list. With the optional tag the aggreagation is logged in a aggreagation.log
file in case one wants to check if something is going wrong. The aggreagation can be stopped anytime with the stopagg
command.
An user can see the latest posts from the feeds he follows by running the browse <num posts to show>
command, bookmark some of them or open them in the browser.