https://github.com/markgx/gofeedfinder
A command-line utility and Go library designed to detect a website's RSS, Atom, or JSON feeds
https://github.com/markgx/gofeedfinder
atom golang jsonfeed rss
Last synced: 5 months ago
JSON representation
A command-line utility and Go library designed to detect a website's RSS, Atom, or JSON feeds
- Host: GitHub
- URL: https://github.com/markgx/gofeedfinder
- Owner: markgx
- License: mit
- Created: 2025-05-07T04:28:28.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-23T06:26:05.000Z (about 1 year ago)
- Last Synced: 2025-06-23T06:29:09.419Z (about 1 year ago)
- Topics: atom, golang, jsonfeed, rss
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# gofeedfinder
[](https://pkg.go.dev/github.com/markgx/gofeedfinder)
A command-line utility and Go library designed to detect a website's RSS, Atom, or JSON feed(s) if available.
## CLI
### Installation
```
go install github.com/markgx/gofeedfinder/cmd/gofeedfinder@latest
```
### Usage
```
gofeedfinder [--with-attributes] [--scan-common-paths]
```
### Arguments
- ``: The URL of the website to check for feeds
### Options
- `--with-attributes`: Display additional feed attributes (title and type) along with the URL
- `--scan-common-paths`: Scan common feed paths when no feeds found in HTML (e.g., /feed, /rss, /atom.xml)
### Examples
Basic usage:
```
$ gofeedfinder https://example.com
https://example.com/feed.xml
https://example.com/atom.xml
```
With attributes:
```
$ gofeedfinder --with-attributes https://example.com
https://example.com/feed.xml title=Example Site Feed type=rss
https://example.com/atom.xml title=Example Site type=atom
```
With common path scanning (when no feeds found in HTML):
```
$ gofeedfinder --scan-common-paths https://example.com
https://example.com/feed
https://example.com/rss.xml
```
## Library
### Installation
```
go get github.com/markgx/gofeedfinder
```
### Usage
```go
import "github.com/markgx/gofeedfinder/pkg/gofeedfinder"
// Find feeds from a website URL
feeds, err := gofeedfinder.FindFeeds("https://example.com")
if err != nil {
// Handle error
}
// Find feeds with additional options
opts := gofeedfinder.Options{
ScanCommonPaths: true, // Scan common paths when no feeds found in HTML
MaxConcurrency: 3, // Maximum concurrent requests for path scanning
}
feeds, err := gofeedfinder.FindFeedsWithOptions("https://example.com", opts)
if err != nil {
// Handle error
}
// Process the discovered feeds
for _, feed := range feeds {
fmt.Printf("URL: %s\n", feed.URL)
fmt.Printf("Title: %s\n", feed.Title)
fmt.Printf("Type: %s\n", feed.Type) // "rss", "atom", or "json"
}
// Extract feed links from HTML with a base URL
html := `...`
url := "https://example.com"
feeds := gofeedfinder.ExtractFeedLinks(html, url)
```