Rizz.Parser (Rizz v0.1.0)

View Source

Responsible for parsing RIZZ XML feeds into Elixir data structures.

Uses ElixirFeedParser as the base parser and extends it with AI metadata from the RIZZ specification.

Summary

Functions

Enhances a standard feed with RIZZ AI metadata.

Extracts JSON-LD data from a script tag if present.

Parses a RIZZ XML string into a Feed struct.

Parses the AI models string into a list of model names.

Functions

enhance_with_ai_metadata(feed, xml)

Enhances a standard feed with RIZZ AI metadata.

extract_json_ld(item_node)

Extracts JSON-LD data from a script tag if present.

parse(xml)

@spec parse(String.t()) :: {:ok, map()} | {:error, any()}

Parses a RIZZ XML string into a Feed struct.

Example

iex> xml = "<?xml version=\"1.0\"?><rss version=\"2.0\"><channel><title>Feed</title></channel></rss>"
iex> {:ok, feed} = Rizz.Parser.parse(xml)
iex> feed.title
"Feed"

parse_models(models_str)

Parses the AI models string into a list of model names.