2017-11-25 19:40:23 +01:00
|
|
|
Go Library for Miniflux
|
|
|
|
=======================
|
|
|
|
[![Build Status](https://travis-ci.org/miniflux/miniflux-go.svg?branch=master)](https://travis-ci.org/miniflux/miniflux-go)
|
|
|
|
[![GoDoc](https://godoc.org/github.com/miniflux/miniflux-go?status.svg)](https://godoc.org/github.com/miniflux/miniflux-go)
|
|
|
|
|
|
|
|
Client library for Miniflux REST API.
|
|
|
|
|
|
|
|
Requirements
|
|
|
|
------------
|
|
|
|
|
|
|
|
- Miniflux >= 2.0.0
|
|
|
|
- Go >= 1.9
|
|
|
|
|
|
|
|
Installation
|
|
|
|
------------
|
|
|
|
|
|
|
|
```bash
|
|
|
|
go get -u github.com/miniflux/miniflux-go
|
|
|
|
```
|
|
|
|
|
|
|
|
Example
|
|
|
|
-------
|
|
|
|
|
|
|
|
```go
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2018-04-30 03:56:40 +02:00
|
|
|
"io/ioutil"
|
2017-11-25 19:40:23 +01:00
|
|
|
"github.com/miniflux/miniflux-go"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
client := miniflux.NewClient("https://api.example.org", "admin", "secret")
|
|
|
|
|
|
|
|
// Fetch all feeds.
|
2017-11-26 01:53:51 +01:00
|
|
|
feeds, err := client.Feeds()
|
2017-11-25 19:40:23 +01:00
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
fmt.Println(feeds)
|
2018-01-13 03:16:51 +01:00
|
|
|
|
2018-04-30 03:56:40 +02:00
|
|
|
// Backup your feeds to an OPML file.
|
2018-01-13 03:16:51 +01:00
|
|
|
opml, err := client.Export()
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
err = ioutil.WriteFile("opml.xml", opml, 0644)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-04-30 03:56:40 +02:00
|
|
|
fmt.Println("backup done!")
|
2017-11-25 19:40:23 +01:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Credits
|
|
|
|
-------
|
|
|
|
|
|
|
|
- Author: Frédéric Guillot
|
|
|
|
- Distributed under MIT License
|