Add extractor for om.co

This commit is contained in:
Shadowfacts 2019-11-01 18:27:15 -04:00
parent 5d38d9567e
commit 9264c9a97d
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 23 additions and 0 deletions

View File

@ -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