Update nikiroo-utils, use it, fix 2 bugs:
[gofetch.git] / src / be / nikiroo / gofetch / support / LeMonde.java
index 454b7e36a82d35a8674c86f186230ebe4f88ae1f..d11ba797f7767cb89e84793fb2234de2b5417b6d 100644 (file)
@@ -28,7 +28,7 @@ public class LeMonde extends BasicSupport {
                for (String topic : new String[] { "international", "politique",
                                "societe", "sciences" }) {
                        URL url = new URL("http://www.lemonde.fr/" + topic + "/1.html");
-                       InputStream in = open(url);
+                       InputStream in = downloader.open(url);
                        Document doc = DataUtil.load(in, "UTF-8", url.toString());
                        Elements articles = doc.getElementsByTag("article");
                        for (Element article : articles) {
@@ -74,16 +74,11 @@ public class LeMonde extends BasicSupport {
                // some javascript, I need to check...)
 
                URL url = new URL(story.getUrlInternal());
-               InputStream in = open(url);
+               InputStream in = downloader.open(url);
                Document doc = DataUtil.load(in, "UTF-8", url.toString());
                Element article = doc.getElementById("articleBody");
                if (article != null) {
-                       for (String line : toLines(article, new QuoteProcessor() {
-                               @Override
-                               public String processText(String text) {
-                                       return text;
-                               }
-
+                       for (String line : toLines(article, new BasicElementProcessor() {
                                @Override
                                public boolean ignoreNode(Node node) {
                                        if (node instanceof Element) {
@@ -96,11 +91,6 @@ public class LeMonde extends BasicSupport {
                                        return false;
                                }
 
-                               @Override
-                               public boolean detectQuote(Node node) {
-                                       return false;
-                               }
-
                                @Override
                                public String manualProcessing(Node node) {
                                        if (node instanceof Element) {