Add extractor for om.co
This commit is contained in:
parent
5d38d9567e
commit
9264c9a97d
|
@ -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
|
Loading…
Reference in New Issue