brrss

package module
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 8 Imported by: 0

README

BrRSS

latest release

HTML-to-RSS bridge that can be used as a serverless function or run as a server.

Getting started

Container

  1. Pull and run registry.gitlab.com/buzzer13/brrss:<tag> image (tag can be either latest, or a specific version like v1.0.0).
    • Command: docker run --name=brrss -it "registry.gitlab.com/buzzer13/brrss:latest"
    • Server doesn't enable an authentication by default, so you may want to check configuration section.

Configuration

Environment variables

  • API_KEY - when set - enables key auth for the API and requires api-key parameter to be present in every query.
  • API_USERNAME, API_PASSWORD - when both are set - enables basic auth for the API.

Both API_KEY and API_PASSWORD can be either the plain string or bcrypt-compatible hash.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTMLToFeed

func HTMLToFeed(body io.Reader, feedFormat FeedFormat, options HTMLToFeedOptions) (string, error)

func SelectText

func SelectText(item *goquery.Selection, selKind SelKind, selCustom string, options *SelectTextOptions) (string, error)

func TryParseTime

func TryParseTime(layout string, value string) time.Time

func TrySelectText

func TrySelectText(item *goquery.Selection, selKind SelKind, selCustom string, options *SelectTextOptions) string

Types

type FeedFormat

type FeedFormat string
const (
	AtomFeedFormat FeedFormat = "atom"
	JSONFeedFormat FeedFormat = "json"
	RSSFeedFormat  FeedFormat = "rss"
)

type HTMLToFeedOptions

type HTMLToFeedOptions struct {
	BaseURL      url.URL
	SelItem      string
	SelFeedTitle string
	SelFeedDesc  string
	SelItemTime  string
	SelItemDesc  string
	SelItemLink  string
	SelItemTitle string
}

type SelKind

type SelKind int64
const (
	FeedTitleSelKind SelKind = iota
	FeedDescSelKind
	ItemTitleSelKind
	ItemLinkSelKind
	ItemDescSelKind
	ItemTimeSelKind
)

type SelectTextOptions

type SelectTextOptions struct {
	BaseURL url.URL
}

Directories

Path Synopsis
cmd
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.

Jump to

Keyboard shortcuts

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