feeds

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

README

Feeds Finder

Build Status

Feeds finder is Go package that provides functions for finding RSS/Atom feeds in a web page.

New in fork

switch on go mod

Installation

go get github.com/gilliek/go-feedsfinder/feeds

Usage

Typical usage:

package main

import (
	"fmt"
	"log"

	"github.com/gilliek/go-feedsfinder/feeds"
)

func main() {
	links, err := feeds.FindFromURL("http://www.example.com")
	if err != nil {
		log.Fatal(err)
	}

    fmt.Println(links)

    //...
}

Output:

[{http://blog.golang.org/feed.atom atom}]

See the document for more details.

Documentation

Document can be found on GoWalker or GoDoc

License

BSD 3-clauses

Documentation

Overview

Package feeds provides functions for finding RSS/Atom feeds in a web page.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Link struct {
	// URL contains the reference to the RSS/Atom feed.
	URL string

	// Type is the type of the feed. It can be either "rss" or "atom".
	Type string
}

Link holds information about a link to a RSS or Atom feed.

func Find

func Find(b []byte, baseURL string) ([]Link, error)

Find finds RSS/Atom feeds in a web page given as a byte slice.

baseURL is the URL of the web page. This is used to deal with absolute path.

func FindFromFile

func FindFromFile(filePath string, baseURL string) ([]Link, error)

FindFromFile finds RSS/Atom feeds in a web page given as a file path.

baseURL is the URL of the web page. This is used to deal with absolute path.

func FindFromURL

func FindFromURL(url string) ([]Link, error)

FindFromURL finds RSS/Atom feeds in a web page given as an URL.

Jump to

Keyboard shortcuts

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