Fix download order and comments/content storing
[gofetch.git] / src / be / nikiroo / gofetch / support / Slashdot.java
index 5dfa03b227e30e2786d0a3dacf0195c6e5d66096..6a5395498de5894657e39311cc68ee3b8f9529e2 100644 (file)
@@ -14,6 +14,11 @@ import org.jsoup.select.Elements;
 import be.nikiroo.gofetch.data.Comment;
 import be.nikiroo.gofetch.data.Story;
 
+/**
+ * Support <a href='https://slashdot.org/'>https://slashdot.org/</a>.
+ * 
+ * @author niki
+ */
 public class Slashdot extends BasicSupport {
        @Override
        public String getDescription() {
@@ -33,6 +38,7 @@ public class Slashdot extends BasicSupport {
                        if (titles.size() == 0) {
                                continue;
                        }
+
                        Element title = titles.get(0);
 
                        String id = "" + title.attr("id");
@@ -70,7 +76,7 @@ public class Slashdot extends BasicSupport {
        }
 
        @Override
-       public List<Comment> getComments(Story story) throws IOException {
+       public void fetch(Story story) throws IOException {
                List<Comment> comments = new ArrayList<Comment>();
 
                URL url = new URL(story.getUrlInternal());
@@ -81,7 +87,7 @@ public class Slashdot extends BasicSupport {
                        comments.addAll(getComments(listing));
                }
 
-               return comments;
+               story.setComments(comments);
        }
 
        private List<Comment> getComments(Element listing) {