readability/lib/readability.ex

11 lines
270 B
Elixir

defmodule Readability do
alias Readability.TitleFinder
@type html_tree :: tuple | list
def title(html) when is_binary(html), do: parse(html) |> title
def title(html_tree), do: TitleFinder.title(html_tree)
defp parse(raw_html), do: Floki.parse(raw_html)
end