OpenGraph (ogp v1.1.0)
Summary
Functions
Fetch URL and parse Open Graph protocol.
Similar to fetch/2 but raises an OpenGraph.Error if request failed.
Parse Open Graph protocol.
Types
Functions
Link to this function
fetch(url, req_options \\ [])
@spec fetch(url(), req_options :: keyword()) :: {:ok, t()} | {:error, OpenGraph.Error.t()}
Fetch URL and parse Open Graph protocol.
Returns {:ok, %OpenGraph{}} for succussful request, otherwise, returns {:error, %OpenGraph.Error{}}.
Link to this function
fetch!(url, req_options \\ [])
Similar to fetch/2 but raises an OpenGraph.Error if request failed.
Returns %OpenGraph{}.
Link to this function
parse(html)
Parse Open Graph protocol.
Returns %OpenGraph{}.
Examples
iex> OpenGraph.parse("<meta property='og:title' content='GitHub' />")
%OpenGraph{title: "GitHub"}