Skip to content

TimmyLin21/gator

Repository files navigation

Gator - RSS Reader

Gator is a CLI-based RSS feed aggregator built in Go. It allows multiple users to register, follow their favorite blogs, and aggregate posts into a local PostgreSQL database.

🛠 Prerequisites

Before installing Gator, ensure you have the following installed:

  • Go: Installation Guide (Version 1.20+)
  • Postgres:
    • macOS: brew install postgresql@15
    • Linux: sudo apt update && sudo apt install postgresql postgresql-contrib

🚀 Installation

  1. Install the binary:
    From the root of the project, run:

    go install github.com/TimmyLin21/gator@latest

    Note: Ensure your $GOPATH/bin (usually ~/go/bin) is in your system's PATH to run >the gator command from any directory.

⚙️ Configuration

Gator requires a connection to a PostgreSQL database to store users and feeds.

  1. Create the database:

    CREATE DATABASE gator;
  2. Setup Config File:
    Create a ~/.gatorconfig.json file in your home directory:

    {  
      "db\_url": "postgres://username:@localhost:5432/gator?sslmode=disable"  
    }

    IMPORTANT
    The ?sslmode=disable flag is required for most local PostgreSQL installations to avoid >connection errors.

💻 Usage

All commands should be invoked using the lowercase gator binary.

Command Description
gator register <name> Create a new user and log in automatically
gator login <name> Switch current user context
gator users List all registered users
gator addfeed <name> <url> Add a new RSS feed to the system
gator feeds View all available feeds
gator follow <url> Follow a feed (for the current user)
gator unfollow <url> Unfollow a feed
gator following List all feeds followed by the current user
gator agg <time> Fetch posts from followed feeds (e.g., 1m, 30s, 1h)
gator reset Warning: Deletes all users and data

🚦 Quick Start Example

Get started with these three steps:

  1. Register your account:

    gator register tim
  2. Login your account:

    gator login tim
  3. Add and follow a feed:

    gator addfeed "Boot.dev Blog" https://www.boot.dev/blog/index.xml
  4. Aggregate posts:
    Fetch new posts every minute:

    gator agg 1m

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages