Skip to content

Vikuuu/gator

Repository files navigation

Gator 🐊

This is RSS feed aggregator in Go!

Feature

  • Add RSS feeds from across the internet to be collected.
  • Store the collected posts in PostgreSQL databse.
  • Follow and unfollow RSS feeds other users have added.

Installing Go

For this CLI tool to work you will have to install GO(obviously..😜)

You will need to install Go(version 1.23+), you can follow this [installation instruction ]

  • If you're getting a "command not found" error after following installation, it's most likely because the directory containing the go program isn't in yout PATH. You need to add the directory to your PATH by modifying your shell's configuration file. First, you need to know where the go command was installed. It might be in:

  • /usr/local/go/bin (official installation)

  • Somewhere else?

You can ensure it exists by attempting to run go using its full filepath. For example, if you think it's in ~/.local/opt/go/bin, you can run ~/.local/opt/go/bin/go version. If that works, then you just need to add ~/.local/opt/go/bin to your PATH and reload your shell:

# For Linux/WSL
echo 'export PATH=$PATH:$HOME/.local/opt/go/bin' >> ~/.bashrc
# next, reload your shell configuration
source ~/.bashrc

Installing Gator

Use can install the gator by using go install command:

go install github.com/Vikuuu/gator

Config

Gator is a multi-user CLI application. There's no server(other than the database), so it's only intended for local user.

  • Create file ~/.gatorconfig.json in your root directory, and add the following:
{
    "db_url": "postgres://postgres:postgres@localhost:5432/gator",
}

For this you should have PostgreSQL installed.

Note

You will have to create the database gator manually. Steps are shown here

Installing PostgreSQL

  1. Linux/WSL(Debian):
sudo apt update
sudo apt install postgresql postgresql-contrib
  1. Ensure it is installed by running the following command:
psql --version
  1. Update postgres password(Linux only):
sudo passwd postgres

You can add the postgres as password so that you won't forget.

  1. Start the Postgres server in the background
  • Linux: sudo service postgresql start
  1. Connect to the server, simply using psql client
  • Linux: sudo -u postgres psql

You should see a new prompt that looks like this:

postgres=#
  1. Now create the gator database in your postgresql
postgres=# CREATE DATABASE gator;
  1. You can move to your database by using:
postgres=# \c gator
  1. Check the table in the gator database.
postgres=# \dt

Using the CLI

  • You can register a user by following command:
gator register <name>
  • You can login a user by following command:
gator login <username>
  • You can add feeds by following command:
gator addfeed <feedName> <feedURL>

You can run the command help to get the information on all the available commands:

gator help

About

This is RSS feed aggregator in Go!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published