OpenGraph (ogp v1.0.2)
Link to this section Summary
Functions
Fetch URL and parse Open Graph protocol.
Similar to fetch/1
but raises a OpenGraph.Error
exception if request failed.
Parse Open Graph protocol.
Link to this section Types
Link to this section Functions
Link to this function
fetch(url)
Specs
fetch(String.t()) :: {: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)
Specs
Similar to fetch/1
but raises a OpenGraph.Error
exception if request failed.
Returns %OpenGraph{}
.
Link to this function
parse(html)
Specs
Parse Open Graph protocol.
Returns %OpenGraph{}
.
Examples
iex> OpenGraph.parse("<meta property='og:title' content='GitHub' />")
%OpenGraph{title: "GitHub"}