Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kostyaten/go-rss
RSS 2.0 Parser
https://github.com/kostyaten/go-rss
go golang rss rss-feed-parser rss-parser rss-reader
Last synced: 2 months ago
JSON representation
RSS 2.0 Parser
- Host: GitHub
- URL: https://github.com/kostyaten/go-rss
- Owner: kostyaten
- License: apache-2.0
- Created: 2020-04-18T16:51:18.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-20T04:53:07.000Z (almost 5 years ago)
- Last Synced: 2024-10-16T06:05:06.897Z (3 months ago)
- Topics: go, golang, rss, rss-feed-parser, rss-parser, rss-reader
- Language: Go
- Homepage:
- Size: 40 KB
- Stars: 3
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-repositories - go-rss
README
RSS 2.0 Parser
==============[![Go](https://github.com/kostya-ten/go-rss/workflows/Go/badge.svg?branch=master)](https://github.com/kostya-ten/go-rss/actions)
[![Go Report Card](https://goreportcard.com/badge/github.com/kostya-ten/go-rss)](https://goreportcard.com/report/github.com/kostya-ten/go-rss)
[![GoDoc](https://godoc.org/github.com/kostya-ten/go-rss?status.svg&style=flat)](https://pkg.go.dev/github.com/kostya-ten/go-rss)## Requirements
Golang 1.13+, 1.14+
## Getting It
You can get go-rss by using
$ go get -u github.com/kostya-ten/go-rss
### Parse rss file
```goimport "github.com/kostya-ten/go-rss"
func main() {
feed, err := rss.ParseFile(filename)
if err != nil {
panic(err)
}title := feed.Channel.Title
fmt.Println(title)
}
```### Parse rss url
```goimport "github.com/kostya-ten/go-rss"
func main() {
feed, err := rss.ParseURL("http://static.userland.com/gems/backend/rssTwoExample2.xml", &http.Client{})
if err != nil {
panic(err)
}title := feed.Channel.Title
fmt.Println(title)
}
```### Bulk parse rss url
```go
import "github.com/kostya-ten/go-rss"func main() {
urls := []string{
"https://lenta.ru/rss",
"https://www.interfax.ru/rss.asp",
"https://ria.ru/export/rss2/index.xml",
"http://static.feed.rbc.ru/rbc/logical/footer/news.rss",
"http://tass.ru/rss/v2.xml",
"https://www.vesti.ru/vesti.rss",
}resultRss := rss.ParseBulk(urls, &http.Client{}, &BulkOptions{maxgoroutine: 10, buffer_chan: 10})
for _, v := range resultRss {
fmt.Println(v.Channel.Title)
}
}
```