Update nikiroo-utils, use it, fix 2 bugs:
[gofetch.git] / src / be / nikiroo / gofetch / support / Slashdot.java
index 378b3a4bfdb0cf0c7277397075ccf13d4c33aff5..43d35f4afa13281d8565da54e113fab82529f35f 100644 (file)
@@ -31,7 +31,7 @@ public class Slashdot extends BasicSupport {
                List<Story> list = new ArrayList<Story>();
 
                URL url = new URL("https://slashdot.org/");
-               InputStream in = open(url);
+               InputStream in = downloader.open(url);
                Document doc = DataUtil.load(in, "UTF-8", url.toString());
                Elements articles = doc.getElementsByTag("header");
                for (Element article : articles) {
@@ -81,7 +81,7 @@ public class Slashdot extends BasicSupport {
                List<Comment> comments = new ArrayList<Comment>();
 
                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 listing = doc.getElementById("commentlisting");
                if (listing != null) {
@@ -138,7 +138,7 @@ public class Slashdot 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(">")) { // comment in one-liners
@@ -164,16 +164,6 @@ public class Slashdot extends BasicSupport {
 
                                return false;
                        }
-
-                       @Override
-                       public boolean ignoreNode(Node node) {
-                               return false;
-                       }
-
-                       @Override
-                       public String manualProcessing(Node node) {
-                               return null;
-                       }
                });
        }
 }