Skip to content

Latest commit

 

History

History
71 lines (47 loc) · 1010 Bytes

README.md

File metadata and controls

71 lines (47 loc) · 1010 Bytes

go-opml

Build Status

go-opml aims to be a Go package for parsing OPML files.

Installation

go get github.com/gilliek/go-opml/opml

Usage

Parse OPML from file:

package main

import (
	"fmt"
	"log"

	"github.com/gilliek/go-opml/opml"
)

func main() {
	doc, err := opml.NewOPMLFromFile("path/to/file.xml")
	if err != nil {
		log.Fatal(err)
	}

    xml, _ := doc.XML()
	fmt.Println(xml)

    //...
}

Parse OPML from URL:

package main

import (
	"fmt"
	"log"

	"github.com/gilliek/go-opml/opml"
)

func main() {
	doc, err := opml.NewOPMLFromURL("http://www.example.com/file.xml")
	if err != nil {
		log.Fatal(err)
	}

    xml, _ := doc.XML()
	fmt.Println(xml)

    //...
}

Documentation

Document can be found on GoWalker or GoDoc

License

BSD 3-clauses