mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-11 18:44:26 +00:00
20 lines
361 B
Go
Executable File
20 lines
361 B
Go
Executable File
package example
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"go.m3o.com/rss"
|
|
)
|
|
|
|
// Add a new RSS feed with a name, url, and category
|
|
func AddAnewFeed() {
|
|
rssService := rss.NewRssService(os.Getenv("M3O_API_TOKEN"))
|
|
rsp, err := rssService.Add(&rss.AddRequest{
|
|
Category: "news",
|
|
Name: "bbc",
|
|
Url: "http://feeds.bbci.co.uk/news/rss.xml",
|
|
})
|
|
fmt.Println(rsp, err)
|
|
}
|