blogroll

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package blogroll provides functionality for managing blogroll metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	// From OpenGraph
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
	ImageURL    string `json:"image_url,omitempty"`
	SiteURL     string `json:"site_url,omitempty"`

	// Author information
	Author string `json:"author,omitempty"`

	// From feed
	FeedTitle       string     `json:"feed_title,omitempty"`
	FeedDescription string     `json:"feed_description,omitempty"`
	FeedAuthor      string     `json:"feed_author,omitempty"`
	FeedImageURL    string     `json:"feed_image_url,omitempty"`
	LastUpdated     *time.Time `json:"last_updated,omitempty"`

	// Source tracking
	Source string `json:"source,omitempty"` // "opengraph", "meta", "feed"
}

Metadata represents extracted metadata from a website.

type UpdateResult

type UpdateResult struct {
	FeedURL     string    `json:"feed_url"`
	Handle      string    `json:"handle,omitempty"`
	OldMetadata *Metadata `json:"old_metadata,omitempty"`
	NewMetadata *Metadata `json:"new_metadata,omitempty"`
	Updated     bool      `json:"updated"`
	Error       string    `json:"error,omitempty"`
}

UpdateResult contains the result of updating a single feed's metadata.

type Updater

type Updater struct {
	// contains filtered or unexported fields
}

Updater handles fetching and extracting metadata from external sites.

func NewUpdater

func NewUpdater(timeout time.Duration) *Updater

NewUpdater creates a new Updater with the given timeout.

func (*Updater) FetchMetadata

func (u *Updater) FetchMetadata(ctx context.Context, feedURL string) (*Metadata, error)

FetchMetadata fetches metadata from a site URL or feed URL. It tries multiple sources in order: OpenGraph, HTML meta tags, feed metadata.

Jump to

Keyboard shortcuts

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