modulepackage
0.1.23
Repository: https://github.com/meinside/rss-feeds-go.git
Documentation: pkg.go.dev
# README
rss-feeds-go
A go utility package for handling RSS feeds.
Features
- Fetch RSS feeds from URLs
- RSS feeds
- Atom feeds
- Manually
- Periodically
- Cache fetched RSS feeds locally
- In memory
- In SQLite3 file
- Summarize RSS feed's content with Google Gemini API
- Save summarized contents locally
- In memory
- In SQLite3 file
- Transfer summarized contents to somewhere
- Save summarized contents locally
- Convert cached feeds as RSS XML
Usages / Samples
Usage:
package main
import (
"log"
rf "github.com/meinside/rss-feeds-go"
)
func main() {
if client, err := rf.NewClientWithDB(
"abcdefghijklmnopqrstuvwxyz0123456789", // google ai api key
[]string{ // rss feeds' urls
"https://hnrss.org/newest?points=50",
},
"./database.sqlite3", // sqlite3 db filepath
); err == nil {
// TODO: do something with `client`
}
}
Other sample applications are in ./samples/
directory.
# Functions
NewClient returns a new client with memory cache.
NewClientWithDB returns a new client with SQLite DB cache.
Prettify prettifies given thing in JSON format.
StandardizeJSON standardizes given JSON (JWCC) bytes.
# Interfaces
FeedsItemsCache is an interface of feeds items' cache.