View Source Naiveical.Extractor (Naiveical v0.1.0)

This module allows the extraction of parts of a icalendar text.

Link to this section Summary

Functions

Extract a single content line from an icalendar text. It returns a tuple with {tag-name, properties, value}.

Extract parts of an icalender text, such as all VALARMs. ## Examples

Link to this section Functions

Link to this function

extract_contentline_by_tag(ical_text, tag)

View Source

Extract a single content line from an icalendar text. It returns a tuple with {tag-name, properties, value}.

## Examples:

iex> Naiveical.Extractor.extract_contentline_by_tag("BEGIN:XX\nBEGIN:YY\nA:aa\nB:bb\nEND:YY\nBEGIN:YY\nC:cc\nD:dd\nEND:YY\nEND:XX", "A") {"A","","aa"}

Link to this function

extract_sections_by_tag(ical_text, tag)

View Source

Extract parts of an icalender text, such as all VALARMs. ## Examples:

iex> Naiveical.Extractor.extract_sections_by_tag("BEGIN:XX\nBEGIN:YY\nA:aa\nB:bb\nEND:YY\nBEGIN:YY\nC:cc\nD:dd\nEND:YY\nEND:XX", "XX") ["BEGIN:XX\nBEGIN:YY\nA:aa\nB:bb\nEND:YY\nBEGIN:YY\nC:cc\nD:dd\nEND:YY\nEND:XX"]

iex> Naiveical.Extractor.extract_sections_by_tag("BEGIN:XX\nBEGIN:YY\nA:aa\nB:bb\nEND:YY\nBEGIN:YY\nC:cc\nD:dd\nEND:YY\nEND:XX", "YY") ["BEGIN:YY\nA:aa\nB:bb\nEND:YY", "BEGIN:YY\nC:cc\nD:dd\nEND:YY"]