@Override
protected String getArticleId(Document doc, Element article) {
- return getArticleIntUrl(doc, article).replaceAll("[^0-9]", "");
+ String id = getArticleIntUrl(doc, article).replaceAll("[^0-9]", "");
+ while (id.length() < 10) {
+ id = "0" + id;
+ }
+
+ return id;
}
@Override
id = id.substring(pos + 1);
}
+ while (id.length() < 10) {
+ id = "0" + id;
+ }
return id;
}
}
id = id.substring("title-".length());
}
+ while (id.length() < 10) {
+ id = "0" + id;
+ }
+
return id;
}
protected String getArticleDate(Document doc, Element article) {
Element dateElement = article.getElementsByClass("published").first();
if (dateElement != null) {
- return dateElement.text();
+ return dateElement.attr("title");
}
return "";