glrss_parser/rss

Look at https://www.rssboard.org/rss-specification or https://www.w3schools.com/xml/xml_rss.asp for more information.

The tags and attributes should mostly match the names here.

Types

pub type Category {
  Category(domain: O(String), categories: List(String))
}

Constructors

  • Category(domain: O(String), categories: List(String))
pub type Channel {
  Channel(
    title: String,
    link: String,
    description: String,
    language: O(String),
    copyright: O(String),
    managing_editor: O(String),
    web_master: O(String),
    pub_date: O(date.RssDate),
    last_build_date: O(date.RssDate),
    category: O(Category),
    generator: O(String),
    docs: O(String),
    cloud: O(Cloud),
    ttl: O(Int),
    image: O(Image),
    rating: O(String),
    text_input: O(TextInput),
    skip_hours: List(Int),
    skip_days: List(date.DayOfWeek),
    item: List(Item),
  )
}

Constructors

  • Channel(
      title: String,
      link: String,
      description: String,
      language: O(String),
      copyright: O(String),
      managing_editor: O(String),
      web_master: O(String),
      pub_date: O(date.RssDate),
      last_build_date: O(date.RssDate),
      category: O(Category),
      generator: O(String),
      docs: O(String),
      cloud: O(Cloud),
      ttl: O(Int),
      image: O(Image),
      rating: O(String),
      text_input: O(TextInput),
      skip_hours: List(Int),
      skip_days: List(date.DayOfWeek),
      item: List(Item),
    )
pub type Cloud {
  Cloud(
    domain: String,
    port: Int,
    path: String,
    register_procedure: String,
    protocol: String,
  )
}

Constructors

  • Cloud(
      domain: String,
      port: Int,
      path: String,
      register_procedure: String,
      protocol: String,
    )
pub type Enclosure {
  Enclosure(url: String, length: Int, type_: String)
}

Constructors

  • Enclosure(url: String, length: Int, type_: String)
pub type Image {
  Image(
    url: String,
    title: String,
    link: String,
    width: O(Int),
    height: O(Int),
    description: O(String),
  )
}

Constructors

  • Image(
      url: String,
      title: String,
      link: String,
      width: O(Int),
      height: O(Int),
      description: O(String),
    )
pub type Item {
  Item(
    title: O(String),
    link: O(String),
    description: O(String),
    author: O(String),
    category: O(Category),
    comments: O(String),
    enclosure: O(Enclosure),
    guid: O(String),
    pub_date: O(date.RssDate),
    source: O(Source),
  )
}

Constructors

  • Item(
      title: O(String),
      link: O(String),
      description: O(String),
      author: O(String),
      category: O(Category),
      comments: O(String),
      enclosure: O(Enclosure),
      guid: O(String),
      pub_date: O(date.RssDate),
      source: O(Source),
    )
pub type ParseError {
  UnexpectedSignal(xm.Signal)
  UnexpectedAttribute(List(xm.Attribute))
  UnexpectedData(String)
  XmlmError(xm.InputError)
  PartyError(party.ParseError(PErr))
  NilError
}

Constructors

  • UnexpectedSignal(xm.Signal)
  • UnexpectedAttribute(List(xm.Attribute))
  • UnexpectedData(String)
  • XmlmError(xm.InputError)
  • PartyError(party.ParseError(PErr))
  • NilError
pub type Rss {
  Rss(version: String, channel: Channel)
}

Constructors

  • Rss(version: String, channel: Channel)
pub type Source {
  Source(url: String, name: O(String))
}

Constructors

  • Source(url: String, name: O(String))
pub type TextInput {
  TextInput(
    title: String,
    description: String,
    name: String,
    link: String,
  )
}

Constructors

  • TextInput(
      title: String,
      description: String,
      name: String,
      link: String,
    )

Functions

pub fn empty_rss() -> Rss
pub fn parse(
  rss_xml: String,
  skip_unknown_tags skip: Bool,
) -> Result(Rss, ParseError)
pub fn parse_bits(
  rss_xml: BitArray,
  skip_unknown_tags skip: Bool,
) -> Result(Rss, ParseError)
Search Document