Пример #1
0
 public override void GetChapters()
 {
     if (MangaChapters == null || MangaChapters.Count < 1)
     {
         MangaChapters = new List<MangaChapter>();
         HtmlDocument doc = new HtmlDocument();
         doc.LoadHtml(HttpUtility.GetResponseString(SiteUri));
         var path = "//table[@class='tablesorter'][1]//tbody//tr";
         var query = doc.DocumentNode.SelectNodes(path);
         if (query != null)
             foreach (var node in query)
             {
                 try
                 {
                     var list = new List<HtmlNode>(node.ChildNodes.Where(n => n.Name == "td"));
                     MangaChapter chapter = new KissMangaChapter(HomeSite.SiteUri + "/" + list[0].ChildNodes[0].Attributes["href"].Value, list[0].ChildNodes[0].InnerText, this, list[2].InnerText, list[1].InnerText);
                     MangaChapters.Add(chapter);
                 }
                 catch (Exception ex)
                 {
                     Logger.Write(ex.Message);
                 }
             }
     }
 }
Пример #2
0
        public override void UpdateChapters(bool isDeepScan = false, bool isUseDb = false)
        {
            HtmlDocument doc = new HtmlDocument();
                doc.LoadHtml(HttpUtility.GetResponseString(SiteUri));
                this.LastUpdatedSource=MangaChapters.Select(n => n.UpdatedDate).Max();
                var path = "//table[@class='tablesorter'][1]//tbody//tr";
                var query = doc.DocumentNode.SelectNodes(path);
                if (query != null)
                {
                    foreach (var nodes in query.Select(n => n.ChildNodes))
                    {
                        try
                        {
                            var list = new List<HtmlNode>(nodes.Where(n => n.Name == "td"));
                            if (KissMangaSite.CheckDate(this.LastUpdatedSource, list[2].InnerText))
                            {
                                var chapter = new KissMangaChapter(HomeSite.SiteUri + "/" + list[0].ChildNodes[0].Attributes["href"].Value, list[0].ChildNodes[0].InnerText, this, list[2].InnerText, list[1].InnerText);
                                MangaChapters.Add(chapter);
                                if (callback != null)
                                    callback(null);
                                chapter.Scan(callback, isDeepScan, isUseDb);
                            }
                            else break;
                        }
                        catch (Exception ex)
                        {
                            Logger.Write(ex.Message);
                        }
                    }
                    this.LastUpdatedSource = MangaChapters.Select(n => n.UpdatedDate).Max();
                    if (callback != null)
                        callback(null);

                }
        }