diff --git a/lib/frenzy/pipeline/extractor/om_malik.ex b/lib/frenzy/pipeline/extractor/om_malik.ex new file mode 100644 index 0000000..afa92f7 --- /dev/null +++ b/lib/frenzy/pipeline/extractor/om_malik.ex @@ -0,0 +1,23 @@ +defmodule Frenzy.Pipeline.Extractor.OmMalik do + @moduledoc """ + Extractor for https://om.co + """ + + alias Frenzy.Pipeline.Extractor + @behaviour Extractor + + @impl Extractor + def extract(html_tree) do + case Floki.find(html_tree, ".entry-content") do + [content_elem | _] -> + { + :ok, + # remove related posts list + Floki.filter_out(content_elem, ".rpbt_shortcode") + } + + _ -> + {:error, "no matching elements"} + end + end +end