fetch

package
v0.0.0-...-1b619f9 Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package fetch provides functions for fetching feed data and parsing it into raw items to be processed by the feed package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fetch

func Fetch(p FetchParams) ([]feed.RawItem, int64, error)

Fetch fetches and parses the feed identified by the given p parameters, returning a slice of raw items and the timestamp of the fetch operation.

Types

type Atom

type Atom struct {
	Entries []AtomEntry `xml:"entry"`
	Link    struct {
		Href string `xml:"href,attr"`
	} `xml:"link"`
}

type AtomEntry

type AtomEntry struct {
	ID    string `xml:"id"`
	GUID  string `xml:"guid"`
	Links []struct {
		Href string `xml:"href,attr"`
		Rel  string `xml:"rel,attr"`
	} `xml:"link"`
	Title     string   `xml:"title"`
	Published string   `xml:"published"`
	Updated   string   `xml:"updated"`
	Authors   []string `xml:"author>name"`
	Content   string   `xml:"content"`
	Summary   string   `xml:"summary"`
}

type FetchParams

type FetchParams struct {
	URL        string
	FeedName   string
	FeedType   string
	FeedParams any
}

FetchParams represents the parameters needed to fetch and parse a feed.

type RSS

type RSS struct {
	Channel struct {
		Items []RSSItem `xml:"item"`
		Link  string    `xml:"link"`
	} `xml:"channel"`
	Items []RSSItem `xml:"item"`
}

type RSSItem

type RSSItem struct {
	ID          string   `xml:"id"`
	GUID        string   `xml:"guid"`
	Link        string   `xml:"link"`
	Title       string   `xml:"title"`
	PubDate     string   `xml:"pubDate"`
	Date        string   `xml:"date"`
	Creator     []string `xml:"creator"`
	Authors     []string `xml:"author>name"`
	Encoded     string   `xml:"encoded"`
	Description string   `xml:"description"`
}

Jump to

Keyboard shortcuts

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