diff options
Diffstat (limited to 'vendor/github.com/miniflux/miniflux-go/client.go')
-rw-r--r-- | vendor/github.com/miniflux/miniflux-go/client.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/github.com/miniflux/miniflux-go/client.go b/vendor/github.com/miniflux/miniflux-go/client.go index 8440a31..d6036dd 100644 --- a/vendor/github.com/miniflux/miniflux-go/client.go +++ b/vendor/github.com/miniflux/miniflux-go/client.go @@ -7,6 +7,7 @@ package miniflux import ( "encoding/json" "fmt" + "io/ioutil" "net/url" "strconv" ) @@ -213,6 +214,22 @@ func (c *Client) Feeds() (Feeds, error) { return feeds, nil } +// Export creates OPML file. +func (c *Client) Export() ([]byte, error) { + body, err := c.request.Get("/v1/export") + if err != nil { + return nil, err + } + defer body.Close() + + opml, err := ioutil.ReadAll(body) + if err != nil { + return nil, err + } + + return opml, nil +} + // Feed gets a feed. func (c *Client) Feed(feedID int64) (*Feed, error) { body, err := c.request.Get(fmt.Sprintf("/v1/feeds/%d", feedID)) |