Add birchtree.me extractor

This commit is contained in:
Shadowfacts 2022-07-17 15:13:08 -04:00
parent b443afcbf2
commit 852db1520f
2 changed files with 20 additions and 0 deletions

View File

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

View File

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