scrapbook/event

Types

pub opaque type EventBasicData
pub opaque type EventData

This type represents the reasons why reading the desired key value failed.

pub type EventDataError {
  FindKeyValueError(error: html.FindKeyValueError)
  DataFormatErrors(errors: List(EventDataFormatError))
}

Constructors

  • FindKeyValueError(error: html.FindKeyValueError)

    Error in finding the desired key or its value.

  • DataFormatErrors(errors: List(EventDataFormatError))

    Error decoding the JSON.

This type represents the reasons why decoding of the JSON failed.

pub type EventDataFormatError {
  DecodeError(error: json.DecodeError)
  ValidateError
}

Constructors

  • DecodeError(error: json.DecodeError)

    Error decoding JSON structure.

  • ValidateError

    Error validating decoded data with the passed validator.

pub opaque type EventHost
pub opaque type EventParent
pub opaque type EventPhoto
pub opaque type EventPlace
pub opaque type EventSibling
pub opaque type EventTimeDetails
pub opaque type EventVideo

This type represents the reasons why fetching the HTTP data might fail.

pub type FetchError {
  RequestConstructionError(url: String)
  RequestSendError(error: Dynamic)
  FollowRedirectionError
}

Constructors

  • RequestConstructionError(url: String)

    Error constructing request from URL.

  • RequestSendError(error: Dynamic)

    Error sending the request coming from a client.

  • FollowRedirectionError

    Error following the redirection - no target URL found.

pub type HostType {
  User
  Page
}

Constructors

  • User
  • Page
pub opaque type OfflineCity
pub opaque type OfflineLocation
pub type OfflineType {
  Text
  Place
  City
}

Constructors

  • Text
  • Place
  • City
pub type OnlineType {
  MessengerRoom
  ThirdParty
  FacebookLive
  Other
}

Constructors

  • MessengerRoom
  • ThirdParty
  • FacebookLive
  • Other

This type represents the reasons why scraping the event might fail.

pub type ScrapeError {
  UrlError
  FetchError(error: FetchError)
  EventDataError(error: EventDataError)
}

Constructors

  • UrlError

    Error creating the target URL from the input.

  • FetchError(error: FetchError)

    Error retrieving event data.

  • EventDataError(error: EventDataError)

    Error caused by retrieved data that could not be parsed properly.

Functions

pub fn get_event(
  html: String,
) -> Result(EventData, EventDataError)

Get all possible event data from the given HTML string.

pub fn scrape_from_fbid(
  fbid: String,
) -> Result(EventData, ScrapeError)

Scrape an event from the specified event fbid.

pub fn scrape_from_url(
  url: String,
) -> Result(EventData, ScrapeError)

Scrape an event from the specified event URL.

Search Document