Add birchtree.me extractor
This commit is contained in:
parent
b443afcbf2
commit
852db1520f
|
@ -0,0 +1,19 @@
|
||||||
|
defmodule Frenzy.Pipeline.Extractor.Birchtree do
|
||||||
|
@moduledoc """
|
||||||
|
Extractor for https://birchtree.me
|
||||||
|
"""
|
||||||
|
|
||||||
|
alias Frenzy.Pipeline.Extractor
|
||||||
|
@behaviour Extractor
|
||||||
|
|
||||||
|
@impl Extractor
|
||||||
|
def extract(html_tree) do
|
||||||
|
case Floki.find(html_tree, "section.post-content") do
|
||||||
|
[content_elem | _] ->
|
||||||
|
{:ok, content_elem}
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
{:error, "no matching elements"}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -6,6 +6,7 @@ defmodule FrenzyWeb.ConfigureStage.ScrapeStageLive do
|
||||||
{"512 Pixels", Frenzy.Pipeline.Extractor.FiveTwelvePixels},
|
{"512 Pixels", Frenzy.Pipeline.Extractor.FiveTwelvePixels},
|
||||||
{"Ars Technica", Frenzy.Pipeline.Extractor.ArsTechnica},
|
{"Ars Technica", Frenzy.Pipeline.Extractor.ArsTechnica},
|
||||||
{"beckyhansmeyer.com", Frenzy.Pipeline.Extractor.BeckyHansmeyer},
|
{"beckyhansmeyer.com", Frenzy.Pipeline.Extractor.BeckyHansmeyer},
|
||||||
|
{"birchtree.me", Frenzy.Pipeline.Extractor.Birchtree},
|
||||||
{"daringfireball.net", Frenzy.Pipeline.Extractor.DaringFireball},
|
{"daringfireball.net", Frenzy.Pipeline.Extractor.DaringFireball},
|
||||||
{"ericasadun.com", Frenzy.Pipeline.Extractor.EricaSadun},
|
{"ericasadun.com", Frenzy.Pipeline.Extractor.EricaSadun},
|
||||||
{"finertech.com", Frenzy.Pipeline.Extractor.FinerTech},
|
{"finertech.com", Frenzy.Pipeline.Extractor.FinerTech},
|
||||||
|
|
Loading…
Reference in New Issue