This is an Elixir parser for http://dev.opml.org/ files/data. OPML files can be used to transport RSS feed data between different RSS feed readers.
This library needs:
- Elixir >= 1.8.1
- Erlang >= 21
The package can be installed by adding opml_ex
to your list of dependencies in mix.exs
:
def deps do
[
{:opml_ex, git: "https://github.com/xlrl/opml_ex.git", tag: "0.1.0"}
]
Install the library by running:
$ mix deps.get
Read the OPML document:
iex> doc = File.read!("feeds.opml")
<?xml version="1.0" encoding="utf-8"?>
<opml version="1.0">
<head>
<dateCreated>Thu, 04 Apr 2019 17:33:49 +0000</dateCreated>
<title>Some RSS Feed Export</title>
</head>
<body>
<outline text="My Category">
<outline type="rss" text="My Feed" xmlUrl="http://feed.org/index.xml" htmlUrl="http://feed.org/index.html"/>
</outline>
</body>
</opml>
Pass the document to opml_ex
:
iex> opml = Opml.parse(doc)
{:ok, [{"My Category", [{"My Feed", ""http://feed.org/index.xml", "http://feed.org/index.html}]}]}
The result is map list of tuples with categories.
Each category contains a list of feeds.
We use http://semver.org/ for versioning. For the versions available, see the tags on this repository.
- Alexander Mueller - initial work
This project is licensed under the MIT license - see the LICENSE file for details.