A CLI blog aggregator written in Go that allows users to store RSS feeds and posts in a local PostgreSQL database.
Before running gatorcli you will need:
- Go installed, download + install here
- PostgreSQL installed, download + install here
To install gatorcli on your system, go to your preferred terminal application and run:
go install github.com/jordanrogrs/gatorcli@latest
To use gatorcli, we'll need to set up a .gatorconfig.json file in your home directory with a link pointing to the PostgreSQL database used by gatorcli. Run the following command in your terminal. Be sure to change the <username> to your system's username.
cat <<EOF > ~/.gatorconfig.json
{
"db_url": "postgres://<username>@localhost:5432/gatorcli"
}
EOFIf you don't know your system username, you can find it by using the following command in the terminal:
whoamiAfter installation, the gatorcli command will be available in your terminal.
- Register a user:
gatorcli register jordan- Add a feed:
gatorcli addfeed "Hacker News" "https://news.ycombinator.com/rss"- Follow the feed:
gatorcli follow "https://news.ycombinator.com/rss"- Start the aggregator:
gatorcli agg 1m- Browse posts:
gatorcli browseAvailable gatorcli commands:
- register:
gatorcli register <user>- creates a new user and automatically logs them in - login:
gatorcli login <user>- switches the logged in user - users:
gatorcli users- lists all users in the database, displays current user logged in
- addfeed:
gatorcli addfeed <name> <url>- adds a feed to the database - feeds:
gatorcli feeds- lists all feeds in the database - follow:
gatorcli follow <url>- allows user to follow a feed - following:
gatorcli following- lists all feeds logged in user is following - unfollow:
gatorcli unfollow- removes feed from user profile
- browse:
gatorcli browse [limit]- displays the latest posts from a user's followed feeds, default is 2 posts - agg:
gatorcli agg <time_between_requests>- continuously scrapes the logged in user's feeds at a specified interval
- reset:
gatorcli reset- CAUTION - deletes the entire database
To get started, you'll need to register a user and add your first feed, then you can use the agg command to scrape it! Gatorcli was designed to have one terminal open and scraping the web in the background while you use another terminal to browse the posts.