feedfinder

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 13 Imported by: 0

README

feedfinder

feedfinder is a library for finding RSS and Atom feeds on a website.

Usage

  1. Install the package:
go get github.com/0x2E/feedfinder
  1. Import the package:
package main

import (
	"context"
	"fmt"

	"github.com/0x2E/feedfinder"
)

func main() {
	link := "https://github.com/golang/go"

	feeds, err := feedfinder.Find(context.Background(), link, nil)
	if err != nil {
		panic(err)
	}

	for _, feed := range feeds {
		fmt.Printf("title: %s\tlink: %s\n", feed.Title, feed.Link)
	}
}

// Output:
// title: golang/go commits        link: https://github.com/golang/go/commits.atom
// title: golang/go releases       link: https://github.com/golang/go/releases.atom
// title: golang/go tags   link: https://github.com/golang/go/tags.atom
// title: golang/go wiki   link: https://github.com/golang/go/wiki.atom

How it works

It tries to find feeds in the following ways:

Parsing HTML:

  • <link> with type application/rss+xml, application/atom+xml, application/json, application/feed+json
  • <a> containing the word rss

Well-known paths:

  • atom.xml, feed.xml, rss.xml, index.xml
  • atom.json, feed.json, rss.json, index.json
  • feed/, rss/

Third party services:

Credits

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Feed added in v0.0.2

type Feed struct {
	Title string `json:"title"`
	Link  string `json:"link"`
}

func Find

func Find(ctx context.Context, target string, options *Options) ([]Feed, error)

type Finder

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

func (*Finder) Run

func (f *Finder) Run(ctx context.Context) ([]Feed, error)

type Options

type Options struct {
	// RequestProxy is the proxy url for HTTP client
	RequestProxy *string
}

Jump to

Keyboard shortcuts

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