rss

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2018 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ItemScanner = felix.ScanFunc(func(ctx context.Context, r io.Reader, e felix.Emitter) error {
	fp := gofeed.NewParser()
	feed, err := fp.Parse(r)

	if err != nil {
		return errors.Wrap(err, "could not parse RSS feed")
	}

	for _, item := range feed.Items {
		e.EmitItem(felix.Item{
			Title:   item.Title,
			URL:     item.Link,
			PubDate: time.Now(),
		})
	}

	return nil
})

ItemScanner parses r as an RSS feed and extracts all feed items.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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