List<Story> list = new ArrayList<Story>();
URL url = new URL("https://slashdot.org/");
- InputStream in = open(url);
+ InputStream in = downloader.open(url);
Document doc = DataUtil.load(in, "UTF-8", url.toString());
Elements articles = doc.getElementsByTag("header");
for (Element article : articles) {
List<Comment> comments = new ArrayList<Comment>();
URL url = new URL(story.getUrlInternal());
- InputStream in = open(url);
+ InputStream in = downloader.open(url);
Document doc = DataUtil.load(in, "UTF-8", url.toString());
Element listing = doc.getElementById("commentlisting");
if (listing != null) {
}
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(">")) { // comment in one-liners
return false;
}
-
- @Override
- public boolean ignoreNode(Node node) {
- return false;
- }
-
- @Override
- public String manualProcessing(Node node) {
- return null;
- }
});
}
}