Compare commits
No commits in common. "9264c9a97dbdc9b2ba1d58a8e9e3a0a3fa759df7" and "1a934430ccc197fd5aafc3a2a31f92a6f99d3316" have entirely different histories.
9264c9a97d
...
1a934430cc
|
@ -1,23 +0,0 @@
|
|||
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
|
|
@ -39,21 +39,15 @@ defmodule Frenzy.Pipeline.ScrapeStage do
|
|||
end
|
||||
end
|
||||
|
||||
case opts do
|
||||
{:ok, opts} ->
|
||||
case opts["convert_to_data_uris"] do
|
||||
nil ->
|
||||
{:ok, %{opts | convert_to_data_uris: true}}
|
||||
case opts["convert_to_data_uris"] do
|
||||
nil ->
|
||||
{:ok, %{opts | convert_to_data_uris: true}}
|
||||
|
||||
value when is_boolean(value) ->
|
||||
{:ok, opts}
|
||||
|
||||
_ ->
|
||||
{:error, "convert_to_data_uris must be a boolean"}
|
||||
end
|
||||
value when is_boolean(value) ->
|
||||
{:ok, opts}
|
||||
|
||||
_ ->
|
||||
opts
|
||||
{:error, "convert_to_data_uris must be a boolean"}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue