feedme

module
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 License: BSD-2-Clause

README

feedme

An Atom feed generator adhering to RFC 4287 standards

Table of Contents

  1. Introduction
  2. Requirements
  3. Usage

Introduction

The purpose of this service is to generate Atom feeds for sites, services, or protocols which do not natively generate feeds (or do not generate useful feeds).

Atom is defined according to RFC 4287. Note that not all possible definitions of an Atom feed can be generated with this repository (see Appendix B); however, each generated Atom feed can be validated according to this standard.

Requirements

A working Golang 1.17+ installation is required.

Installation

Build and install the application.

make
$ make install

Usage

Feedme's feed generating capabilities can be accessed via its atom package in golang:

import (
	"fmt"
	"time"

	"git.sr.ht/~bossley9/feedme/pkg/atom"
)

func main() {
	date, errDate := time.Parse("2006-01-02 15:04", "2022-07-08 08:26")
	if errDate != nil {
		t.Error(errDate)
	}

	feed, errCreateFeed := atom.CreateFeed("example.com", "My Website", date)
	if errCreateFeed != nil {
		t.Error(errCreateFeed)
	}

	fmt.Println(feed.String())

	// outputs:
	//
	// <?xml version="1.0" encoding="UTF-8"?>
	// <feed xmlns="http://www.w3.org/2005/Atom">
	//   <id>example.com</id>
	//   <title>My Website</title>
	//   <updated>2022-07-08T08:26:00Z</updated>
	// </feed>
}

Directories

Path Synopsis
pkg
api

Jump to

Keyboard shortcuts

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