Exemplo n.º 1
0
 static public HtmlDocument GetCustomPage()
 {
     if (_customPage == null)
     {
         _customPage = RequestSender.GetRequestPage(_customPageUrl);
     }
     return(_customPage);
 }
Exemplo n.º 2
0
        static public HtmlDocument GetGenrePageHtml()
        {
            var genrePageUrl = ConfigsMain.GetDomen() + "/g";

            if (_genrePage == null)
            {
                _genrePage = RequestSender.GetRequestPage(genrePageUrl);
            }
            return(_genrePage);
        }
Exemplo n.º 3
0
        public List <Book> GetBookList()
        {
            var doc           = RequestSender.GetRequestPage(_siteUrl);
            var htmlBooksPage = doc.DocumentNode.SelectNodes(_bookLocator);
            var resultBooks   = new List <Book>();

            foreach (var node in htmlBooksPage)
            {
                resultBooks.Add(new Book(node.InnerText, node.GetAttributeValue("href", "error")));
            }
            return(resultBooks);
        }
Exemplo n.º 4
0
        public string GetBookAnotation(string url)
        {
            var bookUri = _siteDomen + url;
            var doc     = RequestSender.GetRequestPage(bookUri);
            var node    = doc.DocumentNode.SelectSingleNode(_bookAnotationLocator);

            if (node == null)
            {
                return(_blankAnnotationString);
            }
            else
            {
                return(node.InnerText);
            }
        }
Exemplo n.º 5
0
        public Image LoadBookImage(string url)
        {
            var bookUri = _siteDomen + url;
            var doc     = RequestSender.GetRequestPage(bookUri);
            var node    = doc.DocumentNode.SelectSingleNode(_imageLocator);

            if (node == null)
            {
                return(RequestSender.GetImageStub());
            }
            else
            {
                var imageUrl = node.GetAttributeValue("src", "error");
                imageUrl = _siteDomen + imageUrl;
                return(RequestSender.LoadImageFromUrl(imageUrl));
            }
        }