Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you use an outline? #1

Open
jtagcat opened this issue Jan 28, 2020 · 1 comment
Open

How do you use an outline? #1

jtagcat opened this issue Jan 28, 2020 · 1 comment

Comments

@jtagcat
Copy link

jtagcat commented Jan 28, 2020

Don't really understand go yet, how am I supposed to get multiple xmlURL-s (from a file)? All examples are // ....

@gilliek
Copy link
Owner

gilliek commented Apr 5, 2020

Sorry for the late reply, I missed the notification.

After reading from a file with opml.NewOPMLFromFile you get an opml.OPML object. From there can get to the list of Outline that actually contains the XMLURL:

doc, err := opml.NewOPMLFromFile("path/to/file.xml")
if err != nil {
   log.Fatal(err)
}
for _, outline := range doc.Body.Outlines {
    fmt.Println("XMLURL:", outline.XMLURL)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants