OpenGraph is an Elixir package to parse OpenGraph data from webpages. (Docs)
iex(1)> OpenGraph.parse("https://yandex.ru")
{:ok,
%OpenGraphData{description: "Найдётся всё",
image: "https://yastatic.net/morda-logo/i/share-logo-ru.png",
title: "Яндекс", url: "https://yandex.ru"}}
iex(2)>
- Add
opengraph
to your list of dependencies inmix.exs
:
def deps do
[{:opengraph, "~> 0.2.0"}]
end
- Ensure
opengraph
is started before your application:
def application do
[applications: [:opengraph]]
end