Skip to content

HellYeahOmg/gator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gator

Gator is a command-line RSS feed aggregator built in Go. It allows users to manage RSS feeds, follow feeds, and browse posts from their subscribed feeds.

Prerequisites

Before running Gator, you need to have the following installed:

Installation

Install the Gator CLI using Go:

go install github.com/hellyeahomg/gator@latest

Configuration

Before using Gator, you need to set up a configuration file with your database connection details.

Create a JSON configuration file (typically ~/.gatorconfig.json) with the following structure:

{
  "db_url": "postgres://username:password@localhost/gator_db?sslmode=disable",
  "current_user_name": ""
}

Replace username, password, and gator_db with your PostgreSQL credentials and database name.

Database Setup

  1. Create a PostgreSQL database for Gator
  2. Run the SQL schema files in the sql/schema/ directory to set up the required tables

Usage

Once installed and configured, you can use the following commands:

User Management

  • gator register <username> - Create a new user account
  • gator login <username> - Log in as an existing user
  • gator users - List all registered users
  • gator reset - Reset/clear user data

Feed Management

  • gator addfeed <feed_name> <feed_url> - Add a new RSS feed
  • gator feeds - List all available feeds
  • gator follow <feed_name> - Follow an RSS feed
  • gator following - Show feeds you're following
  • gator unfollow <feed_name> - Unfollow a feed

Content Management

  • gator agg - Aggregate/fetch new posts from followed feeds
  • gator browse [limit] - Browse recent posts from your followed feeds

Example Workflow

# Register a new user
gator register john

# Add some feeds
gator addfeed techcrunch https://feeds.feedburner.com/TechCrunch
gator addfeed hackernews https://hnrss.org/frontpage

# Follow feeds
gator follow techcrunch
gator follow hackernews

# Fetch new posts
gator agg

# Browse recent posts
gator browse 10

Development

This project uses:

  • PostgreSQL for data storage
  • SQLC for type-safe SQL queries
  • UUID for unique identifiers

The project structure includes:

  • internal/handlers/ - Command handlers
  • internal/commands/ - Command system
  • internal/config/ - Configuration management
  • internal/database/ - Database operations
  • sql/ - SQL schemas and queries

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages