示例#1
0
  private Manga constructPopularMangaFromHtml(Element htmlBlock) {
    Manga manga = new Manga();
    manga.source = getId();

    Element urlElement = Parser.element(htmlBlock, "td a:eq(0)");

    if (urlElement != null) {
      manga.setUrl(urlElement.attr("href"));
      manga.title = urlElement.text();
    }

    return manga;
  }
示例#2
0
  private Chapter constructChapterFromHtmlBlock(Element chapterElement) {
    Chapter chapter = Chapter.create();

    Element urlElement = Parser.element(chapterElement, "a");
    String date = Parser.text(chapterElement, "td:eq(1)");

    if (urlElement != null) {
      chapter.setUrl(urlElement.attr("href"));
      chapter.name = urlElement.text();
    }
    if (date != null) {
      try {
        chapter.date_upload =
            new SimpleDateFormat("MM/dd/yyyy", Locale.ENGLISH).parse(date).getTime();
      } catch (ParseException e) {
        /* Ignore */
      }
    }
    return chapter;
  }