+ return "";
+ }
+
+ @Override
+ protected String getCommentTitle(Element post) {
+ if (post.hasClass("hidden")) {
+ return "";
+ }
+
+ Element title = post.getElementsByClass("title").first();
+ if (title != null) {
+ return title.text();
+ }
+
+ return "";
+ }
+
+ @Override
+ protected String getCommentDate(Element post) {
+ if (post.hasClass("hidden")) {
+ return "";
+ }
+
+ Element date = post.getElementsByClass("otherdetails").first();
+ if (date != null) {
+ return date.text();
+ }
+
+ return "";
+ }
+
+ @Override
+ protected Element getCommentContentElement(Element post) {
+ if (post.hasClass("hidden")) {
+ return null;
+ }
+
+ return post.getElementsByClass("commentBody").first();
+ }
+
+ @Override
+ protected ElementProcessor getElementProcessorComment() {
+ return new BasicElementProcessor() {
+ @Override
+ public String processText(String text) {
+ while (text.startsWith(">")) { // comment in one-liners
+ text = text.substring(1).trim();
+ }
+
+ return text;
+ }
+
+ @Override
+ public boolean detectQuote(Node node) {
+ if (node instanceof Element) {
+ Element elementNode = (Element) node;
+ if (elementNode.tagName().equals("blockquote")
+ || elementNode.hasClass("quote")
+ || (elementNode.tagName().equals("p")
+ && elementNode.textNodes().size() == 1 && elementNode
+ .textNodes().get(0).getWholeText()
+ .startsWith(">"))) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ };