- defp get_oembed_url(nodes) do
- {"link", attributes, _children} = nodes |> hd()
-
- {:ok, Enum.into(attributes, %{})["href"]}
+ defp get_oembed_url([{"link", attributes, _children} | _]) do
+ Enum.find_value(attributes, fn {k, v} -> if k == "href", do: v end)