narfeed

package module
v0.0.0-...-cc7ac40 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2025 License: GPL-2.0 Imports: 9 Imported by: 0

README

NotAlwaysRight feed generator/displayer

Minimalistic program to fetch posts from Notalwaysright.com and either display them directly in a console terminal or create an atom-feed from them.

Motivation

Was tired of not having an easy way to keep track of which posts I had already read on Not Always Right (NAR) so wanted to create a way for me to do so. I also wanted to apply all that I had learned from Boot.dev and make it as adaptable as possible.

Installation and Usage

See the individual pages for the respective variants:

CLI client | GCP Cloud Run function | AWS Lambda

Contributing

Clone the repo
git clone https://github.com/BlackestDawn/nar-feed
cd nar-feed
Build and run

You can use the client version to test the general logic, and the server version for atom-feed generation.

go build ./cmd/cli_client
./cli_client

or

go run ./cmd/cli_client
Submit a pull request

If you'd like to contribute, please fork the repository and open a pull request to the main branch.

TODO

  • Add pagination for console output
  • Actually use CLI parameters
  • Ability to choose/filter sections
  • Some form of "memory" so it only displays new posts since last run
  • Support for running as GCP Gloud Function and AWS Lambda
  • Ansible and Terraform routines for setting up GCP and AWS

Documentation

Index

Constants

View Source
const (
	BaseURL          = "https://notalwaysright.com"
	DefaultPageCount = 3
	DefaultSection   = "newest"
	DefaultTags      = ""
	FeedID           = "91f04a6d-ff1c-4d86-8d50-9962f640eda7"
	FeedTitle        = "Not Always Right"
	FeedDescription  = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FeedData

type FeedData struct {
	URL string

	LastDisplayTime time.Time
	// contains filtered or unexported fields
}

func NewFeedData

func NewFeedData(sections []string, tags []string, pageCount int) (feedData *FeedData, err error)

func (*FeedData) GenerateAtomFeed

func (f *FeedData) GenerateAtomFeed() (feed string, err error)

func (*FeedData) GetIDs

func (f *FeedData) GetIDs() (retVal []string)

func (*FeedData) GetItem

func (f *FeedData) GetItem(id string) (FeedItem, error)

func (*FeedData) GetNewItems

func (f *FeedData) GetNewItems() (returnItems []FeedItem)

func (*FeedData) PrintToConsole

func (f *FeedData) PrintToConsole(paginate bool)

type FeedItem

type FeedItem struct {
	Title     string
	URL       string
	ID        string
	CreatedAt time.Time
	UpdatedAt time.Time
	Content   string
}

Directories

Path Synopsis
cmd
cli_client command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL