- private List<Entry<String, URL>> getChaptersPool(URL source,
- InputStream in, Progress pg) throws IOException {
- List<Entry<String, URL>> urls = new ArrayList<Entry<String, URL>>();
- int last = 1; // no pool/show when only one page
-
- @SuppressWarnings("resource")
- Scanner scan = new Scanner(in, "UTF-8");
- scan.useDelimiter("\\n");
- while (scan.hasNext()) {
- String line = scan.next();
- for (int pos = line.indexOf(source.getPath()); pos >= 0; pos = line
- .indexOf(source.getPath(), pos + source.getPath().length())) {
- int equalPos = line.indexOf("=", pos);
- int quotePos = line.indexOf("\"", pos);
- if (equalPos >= 0 && quotePos > equalPos) {
- String snum = line.substring(equalPos + 1, quotePos);
- try {
- int num = Integer.parseInt(snum);
- if (num > last) {
- last = num;
- }
- } catch (NumberFormatException e) {
+ private String getAuthor() throws IOException {
+ StringBuilder builder = new StringBuilder();
+
+ if (isSearchOrSet(getSource())) {
+ for (Element el : getSourceNode().getElementsByClass("search-tag")) {
+ if (el.attr("itemprop").equals("author")) {
+ if (builder.length() > 0) {
+ builder.append(", ");