View Source z_url_metadata (zotonic_stdlib v1.19.0)

Discover metadata about an url.

Summary

Functions

Fetch metadata information for the URL
Fetch properties of the fetched metadata

Types

-type metadata() ::
    #url_metadata{final_url :: binary(),
                  content_type :: binary(),
                  content_type_options :: list(),
                  content_length :: integer(),
                  metadata :: list(),
                  is_index_page :: boolean(),
                  headers :: list(),
                  partial_data :: binary()}.

Functions

-spec fetch(binary() | string()) -> {ok, metadata()} | {error, term()}.
Fetch metadata information for the URL
-spec fetch(binary() | string(), z_url_fetch:options()) -> {ok, metadata()} | {error, term()}.
-spec filename(binary() | string(), list()) -> binary() | undefined.
-spec header(binary() | string(), metadata()) -> binary() | undefined.
-spec p(atom() | binary() | [atom() | binary()], metadata()) -> [binary()] | binary() | undefined.
Fetch properties of the fetched metadata