Skip to content

potpot1029/gator

Repository files navigation

gator

(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

prerequisite

make sure you have the following installed before running the program:

installation

install the gator CLI using go install:

go install github.com/potpot1029/gator@latest

make sure your $GOPATH/bin (or $HOME/go/bin) is in your PATH so the binary is accessible:

export PATH=$PATH:$(go env GOPATH)/bin

configuration

gator reads configuration from a file located at ~/.gatorconfig.json.

you need to create the file manually:

touch ~/.gatorconfig.json

then 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.

set up the database

run the migrations to set up the required tables in your database:

goose postgres "postgres://<username>:<password>@localhost:5432/<dbname>" up

usage

register a new user

gator register <username>

and you will automatically login in as the user

login as an existing user

gator login <username>

(you will need to login to use to below commands)

add an RSS feed

gator addfeed <feed_name> <feed_url>

follow an existing feed

gator follow <feed_url>

list all feeds you follow

gator following

aggregate posts from all feeds

gator agg <time_between_reqs>

for example, to starts a continuous fetch loop every 30 seconds:

gator agg 30s

browse the latest posts

gator browser [limit]

you can optionally limit the number of posts shown (default is 2)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages