List<Story> list = new ArrayList<Story>();
URL url = new URL("https://lwn.net/");
- InputStream in = open(url);
+ InputStream in = downloader.open(url);
Document doc = DataUtil.load(in, "UTF-8", url.toString());
Elements articles = doc.getElementsByClass("pure-u-1");
for (Element article : articles) {
// Do not try the paid-for stories...
if (!story.getTitle().startsWith("[$]")) {
URL url = new URL(story.getUrlInternal());
- InputStream in = open(url);
+ InputStream in = downloader.open(url);
Document doc = DataUtil.load(in, "UTF-8", url.toString());
Elements fullContentElements = doc
.getElementsByClass("ArticleText");
}
private List<String> toLines(Element element) {
- return toLines(element, new QuoteProcessor() {
+ return toLines(element, new BasicElementProcessor() {
@Override
public String processText(String text) {
while (text.startsWith(">")) { // comments
return false;
}
-
- @Override
- public String manualProcessing(Node node) {
- return null;
- }
});
}
}