Update nikiroo-utils, use it, fix 2 bugs:
[gofetch.git] / src / be / nikiroo / gofetch / support / LWN.java
index c492d10d21cde68e48f1390db8efcf7b0a10c470..27b539c5e42ffa6bec08c5c4e689377bf3742068 100644 (file)
@@ -31,7 +31,7 @@ public class LWN extends BasicSupport {
                List<Story> list = new ArrayList<Story>();
 
                URL url = new URL("https://lwn.net/");
-               InputStream in = open(url);
+               InputStream in = downloader.open(url);
                Document doc = DataUtil.load(in, "UTF-8", url.toString());
                Elements articles = doc.getElementsByClass("pure-u-1");
                for (Element article : articles) {
@@ -99,7 +99,7 @@ public class LWN extends BasicSupport {
                // Do not try the paid-for stories...
                if (!story.getTitle().startsWith("[$]")) {
                        URL url = new URL(story.getUrlInternal());
-                       InputStream in = open(url);
+                       InputStream in = downloader.open(url);
                        Document doc = DataUtil.load(in, "UTF-8", url.toString());
                        Elements fullContentElements = doc
                                        .getElementsByClass("ArticleText");
@@ -167,7 +167,7 @@ public class LWN extends BasicSupport {
        }
 
        private List<String> toLines(Element element) {
-               return toLines(element, new QuoteProcessor() {
+               return toLines(element, new BasicElementProcessor() {
                        @Override
                        public String processText(String text) {
                                while (text.startsWith(">")) { // comments
@@ -201,11 +201,6 @@ public class LWN extends BasicSupport {
 
                                return false;
                        }
-
-                       @Override
-                       public String manualProcessing(Node node) {
-                               return null;
-                       }
                });
        }
 }