- String body = "";
- for (Element elem : article.children()) {
- String tag = elem.tag().toString();
- if (!tag.equals("header") && !tag.equals("footer")) {
- body = elem.text();
- break;
- }
+ @Override
+ protected String getArticleDetails(Document doc, Element article) {
+ return ""; // We alrady extracted all the info
+ }
+
+ @Override
+ protected String getArticleIntUrl(Document doc, Element article) {
+ Element link = article.getElementsByTag("a").first();
+ if (link != null) {
+ return link.absUrl("href");
+ }
+
+ return "";
+ }
+
+ @Override
+ protected String getArticleExtUrl(Document doc, Element article) {
+ Element link = article.getElementsByTag("a").first();
+ if (link != null) {
+ String possibleExtLink = link.absUrl("href").trim();
+ if (!possibleExtLink.isEmpty()
+ && !possibleExtLink.contains("pipedot.org/")) {
+ return possibleExtLink;