- private List<Comment> getComments(Element listing) {
- List<Comment> comments = new ArrayList<Comment>();
- for (Element commentElement : listing.children()) {
- if (commentElement.hasClass("CommentBox")) {
- Comment comment = getComment(commentElement);
- if (!comment.isEmpty()) {
- comments.add(comment);
+ @Override
+ protected List<Element> getFullArticleCommentPosts(Document doc, URL intUrl) {
+ return doc.getElementsByClass("lwn-u-1");
+ }
+
+ @Override
+ protected ElementProcessor getElementProcessorFullArticle() {
+ return new BasicElementProcessor() {
+ @Override
+ public boolean ignoreNode(Node node) {
+ if (node instanceof Element) {
+ Element el = (Element) node;
+ if ("Log in".equals(el.text().trim())) {
+ return true;
+ }
+ } else if (node instanceof TextNode) {
+ TextNode text = (TextNode) node;
+ String t = text.text().trim();
+ if (t.equals("(") || t.equals("to post comments)")) {
+ return true;
+ }