Skip to content

OpsM0nkey/gator-cli

Repository files navigation

(aggre)gator CLI

This project was a boot.dev Golang course. It's an RSS feed aggregator that is built to:

  • Add RSS feeds from across the internet to be collected
  • Store the collected posts in a PostgreSQL database
  • Follow and unfollow RSS feeds that other users have added
  • View summaries of the aggregated posts in the terminal, with a link to the full post

At this time, it doesn not implement user authentication for the database.

Pre-requisites

To run this project, you will need:

  • Go (1.20+) installed
  • PostgreSQL (1.13+) installed and running

Setup and Installation

From source

You can clone this repository down to your local machine and build the binary from source. You can make use of the Makefile using make build in the root of the directory, which will build the binary and place it in the bin/ directory.

Install from Go

Alternatively, you can install the latest version of the gator-cli directly using Go:

go install github.com/opsm0nkey/gator-cli@latest

Usage

Initial configuration

Gator relies on a local configuration file that's default built in your home directory at ~/.gatorconfig.json, which contains the configuration strings for both the user value and the database connection string. This file is automatically generated when you run the CLI for the first time, and takes the logged on user's details as the default for both the database connection and logged in user values. You can provide an alternate database connection value by setting the GATOR_DB_URL environment variable, which will override the value in the config file.

Commands

  • login: Use the login command, along with you username (e.g. gator login alice), to set the logged in user value in the config file. This is used to associate feed follows and posts with a specific user.
  • addfeed: Use the addfeed command, along with the name of the feed and the feed URL (e.g. gator addfeed bootdev https://www.boot.dev/blog/index.xml), to add a new feed to be collected.
  • agg: The agg command will aggregate the content of the feeds in the database so that they can be viewed with the browse command. This is something that would typically be run in the background on a schedule, and is configurable by running gator agg (1m|1h etc...).
  • browse: The browse command will show the aggregated posts in the terminal, along with a link to the original post (e.g. gator browse).
  • feeds: The feeds command will show the feeds that have been added to the database, along with the feed details (e.g. gator feeds).
  • following: The following command will show the feeds that the logged in user is following (e.g. gator following).
  • follow: If used in a multi-user environment, you can use the follow command, along with the feed url (e.g. gator follow https://www.boot.dev/blog/index.xml), to follow a specific feed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors