- public void fetch(Story story) throws IOException {
- String fullContent = story.getContent();
- List<Comment> comments = new ArrayList<Comment>();
- story.setComments(comments);
+ protected String getArticleCategory(Document doc, Element article,
+ String currentCategory) {
+ Element categElement = article.previousElementSibling();
+ if (categElement != null) {
+ return categElement.text();
+ }
+
+ return "";
+ }
+
+ @Override
+ protected String getArticleDetails(Document doc, Element article) {
+ // We have some "details" but no content, so we switch them:
+ return "";
+ }
+
+ @Override
+ protected String getArticleIntUrl(Document doc, Element article) {
+ return article.absUrl("href");
+ }
+
+ @Override
+ protected String getArticleExtUrl(Document doc, Element article) {
+ return "";
+ }
+
+ @Override
+ protected String getArticleContent(Document doc, Element article) {
+ // We have some "details" but no content, so we switch them:
+ Element detailsElement = article.getElementsByClass("standfirst")
+ .first();
+ if (detailsElement != null) {
+ return getArticleText(detailsElement);
+ }
+
+ return "";
+ }
+
+ @Override
+ protected Element getFullArticle(Document doc) {
+ return doc.getElementById("body");
+ }