X-Git-Url: http://git.nikiroo.be/?p=gofetch.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fgofetch%2Fsupport%2FPipedot.java;h=89932f7636c170abc3b34b7c71542880b255984c;hp=1bd5173b331e6e2ee69552efaa77e964a1e3fe20;hb=100a839503d23e324d2db3f6d3e47892def3bf81;hpb=1b084e893e0af0c90524fb137b83984d9bc44c06 diff --git a/src/be/nikiroo/gofetch/support/Pipedot.java b/src/be/nikiroo/gofetch/support/Pipedot.java index 1bd5173..89932f7 100644 --- a/src/be/nikiroo/gofetch/support/Pipedot.java +++ b/src/be/nikiroo/gofetch/support/Pipedot.java @@ -33,9 +33,9 @@ public class Pipedot extends BasicSupport { URL url = new URL("https://pipedot.org/"); InputStream in = open(url); Document doc = DataUtil.load(in, "UTF-8", url.toString()); - Elements stories = doc.getElementsByClass("story"); - for (Element story : stories) { - Elements titles = story.getElementsByTag("h1"); + Elements articles = doc.getElementsByClass("story"); + for (Element article : articles) { + Elements titles = article.getElementsByTag("h1"); if (titles.size() == 0) { continue; } @@ -43,7 +43,7 @@ public class Pipedot extends BasicSupport { Element title = titles.get(0); String id = ""; - for (Element idElem : story.getElementsByTag("a")) { + for (Element idElem : article.getElementsByTag("a")) { if (idElem.attr("href").startsWith("/pipe/")) { id = idElem.attr("href").substring("/pipe/".length()); break; @@ -53,7 +53,7 @@ public class Pipedot extends BasicSupport { String intUrl = null; String extUrl = null; - Elements links = story.getElementsByTag("a"); + Elements links = article.getElementsByTag("a"); if (links.size() > 0) { intUrl = links.get(0).absUrl("href"); } @@ -68,13 +68,13 @@ public class Pipedot extends BasicSupport { } String details = ""; - Elements detailsElements = story.getElementsByTag("div"); + Elements detailsElements = article.getElementsByTag("div"); if (detailsElements.size() > 0) { details = detailsElements.get(0).text(); } String body = ""; - for (Element elem : story.children()) { + for (Element elem : article.children()) { String tag = elem.tag().toString(); if (!tag.equals("header") && !tag.equals("footer")) { body = elem.text(); @@ -165,6 +165,11 @@ public class Pipedot extends BasicSupport { public boolean ignoreNode(Node node) { return false; } + + @Override + public String manualProcessing(Node node) { + return null; + } }); } }