View Source Gluttony (gluttony v0.2.0)
Parses RSS 2.0 and Atom 1.0 feeds.
References
- RSS 2.0 Specs: https://www.rssboard.org/rss-specification
- Atom 1.0 Specs: https://xml2rfc.tools.ietf.org/public/rfc/html/rfc4287.html
extra-information
Extra information
- W3C Feed Docs: https://validator.w3.org/feed/docs/
- RSS 2.0 and Atom 1.0 compared: http://www.intertwingly.net/wiki/pie/Rss20AndAtom10Compared
Link to this section Summary
Functions
Fetches the given url and parses the response.
See parse_string/2 for more information on the result values.
Parses the given string and returns the values.
Link to this section Functions
Fetches the given url and parses the response.
See parse_string/2 for more information on the result values.
Parses the given string and returns the values.
Examples
Parsing a xml string from a RSS feed:
{:ok, %{feed: feed, entries: entries}} = Gluttony.parse_string(xml)When a error happens, the reason is returned:
{:error, reason} = Gluttony.parse_string(xml) You can retrieve a common result interface by specifing the raw option as false.
This might be usefull to retrieve only relevant and common information, since RSS 2.0 and Atom 1.0 are very different specs:
{:ok, %Gluttony.Feed{}} = Gluttony.parse_string(xml, raw: false)