Ejemplo n.º 1
0
        internal static string Get_FilmHome(string html)
        {
            listFilmHome = new List <Models.ListFilmHome>();
            try
            {
                var node = Getnode.GetListTag(html, "div", "class", "movie-list-index home-v2");
                foreach (var itemNode in node)
                {
                    Models.ListFilmHome i = new Models.ListFilmHome();

                    i.Title = Getnode.GetValueHtmlToChird(itemNode, new int[] { 0, 0, 0 }, "");
                    var nodeToItemNode = Getnode.GetListNodeToNode(itemNode, new int[] { 1, 0 });
                    foreach (var item in nodeToItemNode[0].ChildNodes)
                    {
                        Models.FilmItem t = new Models.FilmItem();
                        t.UrlFilm = Getnode.GetValueHtmlToChird(item, new int[] { 0 }, "href");
                        var thumb = Getnode.GetValueHtmlToChird(item, new int[] { 0, 0, 0, 0 }, "style");
                        thumb        = thumb.Replace("background-image:url('", "");
                        thumb        = thumb.Remove(thumb.IndexOf("')"));
                        t.Thumb      = thumb;
                        t.NameFilm_1 = Getnode.GetValueHtmlToChird(item, new int[] { 0, 0, 1, 0 }, "");
                        t.NameFilm_2 = Getnode.GetValueHtmlToChird(item, new int[] { 0, 0, 1, 1 }, "");
                        t.StatusFilm = Getnode.GetValueHtmlToChird(item, new int[] { 0, 0, 1, 2 }, "");
                        t.Ribbon     = Getnode.GetValueHtmlToChird(item, new int[] { 0, 0, 1, 3 }, "");
                        i.listFilmItem.Add(t);
                    }
                    listFilmHome.Add(i);
                }
                if (listFilmHome.Count == 0)
                {
                    json_FilmHome.status = false;
                }
                else
                {
                    json_FilmHome.status = true;
                }
            }
            catch
            {
                var t = listFilmHome;
                json_FilmHome.status = false;
            }
            return(BaseJsonFilmHome());
        }
Ejemplo n.º 2
0
        internal static string Get_FilmHome(string html)
        {
            listFilmHome = new List<Models.ListFilmHome>();
            try
            {
                var node = Getnode.GetListTag(html, "div", "class", "movie-list-index home-v2");
                foreach (var itemNode in node)
                {
                    Models.ListFilmHome i = new Models.ListFilmHome();

                    i.Title = Getnode.GetValueHtmlToChird(itemNode, new int[] { 0, 0, 0 }, "");
                    var nodeToItemNode = Getnode.GetListNodeToNode(itemNode, new int[] { 1, 0 });
                    foreach (var item in nodeToItemNode[0].ChildNodes)
                    {
                        Models.FilmItem t = new Models.FilmItem();
                        t.UrlFilm = Getnode.GetValueHtmlToChird(item, new int[] { 0 }, "href");
                        var thumb = Getnode.GetValueHtmlToChird(item, new int[] { 0, 0, 0, 0 }, "style");
                        thumb = thumb.Replace("background-image:url('", "");
                        thumb = thumb.Remove(thumb.IndexOf("')"));
                        t.Thumb = thumb;
                        t.NameFilm_1 = Getnode.GetValueHtmlToChird(item, new int[] { 0, 0, 1, 0 }, "");
                        t.NameFilm_2 = Getnode.GetValueHtmlToChird(item, new int[] { 0, 0, 1, 1 }, "");
                        t.StatusFilm = Getnode.GetValueHtmlToChird(item, new int[] { 0, 0, 1, 2 }, "");
                        t.Ribbon = Getnode.GetValueHtmlToChird(item, new int[] { 0, 0, 1, 3 }, "");
                        i.listFilmItem.Add(t);
                    }
                    listFilmHome.Add(i);
                }
                if (listFilmHome.Count == 0)
                {
                    json_FilmHome.status = false;
                }
                else
                {
                    json_FilmHome.status = true;
                }

            }
            catch
            {
                var t = listFilmHome;
                json_FilmHome.status = false;
            }
            return BaseJsonFilmHome();
        }