Exoplanet.Post (Exoplanet v0.6.0)

Copy Markdown View Source

Post definition

Exoplanet will produce a list of these feed entries.

Time zones

published and updated are NaiveDateTime values: the original UTC offset from the source feed is discarded (RSS dates are parsed by Exoplanet.DateTimeParser, Atom dates by NaiveDateTime.from_iso8601/1, and neither keeps the zone). The merged feed is sorted by published descending, treating each timestamp as wall-clock time, so posts from feeds in different zones can be ordered relative to each other with an error up to the offset difference (~24h). Normalise to UTC yourself if you need globally-correct chronological ordering.

Summary

Functions

Builds the struct of posts or feed entries

Types

t()

@type t() :: %Exoplanet.Post{
  authors: [String.t()],
  body: String.t() | nil,
  categories: [String.t()] | nil,
  feed_url: String.t(),
  id: String.t(),
  published: NaiveDateTime.t() | nil,
  summary: String.t() | nil,
  title: String.t(),
  updated: NaiveDateTime.t() | nil
}

Functions

build(attrs, body)

@spec build(map(), String.t() | nil) :: t()

Builds the struct of posts or feed entries