X-Git-Url: http://git.nikiroo.be/?p=gofetch.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fgofetch%2Fsupport%2FEreNumerique.java;h=b6a7598027c9b632cb52fb50f22677e4a1a314b4;hp=bef677d9f8a75a3ec3c8faa9e802e05004719e22;hb=b9afb12e17825f363d3679fcac75095fb1e9dc6d;hpb=26816d976f9d888fbf75feb754d761871a988c69 diff --git a/src/be/nikiroo/gofetch/support/EreNumerique.java b/src/be/nikiroo/gofetch/support/EreNumerique.java index bef677d..b6a7598 100644 --- a/src/be/nikiroo/gofetch/support/EreNumerique.java +++ b/src/be/nikiroo/gofetch/support/EreNumerique.java @@ -100,10 +100,29 @@ public class EreNumerique extends BasicSupport { try { Document doc = DataUtil.load(in, "UTF-8", url.toString()); Element article = doc.getElementsByTag("article").first(); + if (article != null) { + article = article.getElementsByAttributeValue("itemprop", + "articleBody").first(); + } if (article != null) { for (String line : toLines(article, new BasicElementProcessor() { - // TODO: ignore headlines/pub + @Override + public boolean ignoreNode(Node node) { + return node.attr("class").contains("chapo"); + } + + @Override + public String isSubtitle(Node node) { + if (node instanceof Element) { + Element element = (Element) node; + if (element.tagName().startsWith("h") + && element.tagName().length() == 2) { + return element.text(); + } + } + return null; + } })) { fullContent += line + "\n"; }