Update nikiroo-utils, use it, fix 2 bugs:
[gofetch.git] / src / be / nikiroo / gofetch / support / Pipedot.java
index 89932f7636c170abc3b34b7c71542880b255984c..17388b21030f5cbdbbd12518b9b0b1023594fff5 100644 (file)
@@ -31,7 +31,7 @@ public class Pipedot extends BasicSupport {
                List<Story> list = new ArrayList<Story>();
 
                URL url = new URL("https://pipedot.org/");
-               InputStream in = open(url);
+               InputStream in = downloader.open(url);
                Document doc = DataUtil.load(in, "UTF-8", url.toString());
                Elements articles = doc.getElementsByClass("story");
                for (Element article : articles) {
@@ -94,7 +94,7 @@ public class Pipedot 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());
                Elements listing = doc.getElementsByTag("main");
                if (listing.size() > 0) {
@@ -142,12 +142,7 @@ public class Pipedot extends BasicSupport {
        }
 
        private List<String> toLines(Element element) {
-               return toLines(element, new QuoteProcessor() {
-                       @Override
-                       public String processText(String text) {
-                               return text;
-                       }
-
+               return toLines(element, new BasicElementProcessor() {
                        @Override
                        public boolean detectQuote(Node node) {
                                if (node instanceof Element) {
@@ -160,16 +155,6 @@ public class Pipedot extends BasicSupport {
 
                                return false;
                        }
-
-                       @Override
-                       public boolean ignoreNode(Node node) {
-                               return false;
-                       }
-
-                       @Override
-                       public String manualProcessing(Node node) {
-                               return null;
-                       }
                });
        }
 }