Esempio n. 1
0
        protected override List <VideoInfo> Parse(string url, string data)
        {
            nextPageUrl = url;
            url         = String.Format(url, ++videoPageNr);
            if (data == null)
            {
                data = GetWebData(url);
            }

            List <VideoInfo> videos = new List <VideoInfo>();
            XmlDocument      doc    = new XmlDocument();

            doc.LoadXml(data);
            foreach (XmlNode node in doc.SelectNodes("//getItems/items/row"))
            {
                string title   = node.SelectSingleNode("title").InnerText;
                string episode = getXmlValue(node, "episode");

                if (!String.IsNullOrEmpty(episode) && episode != "0")
                {
                    title += ", odcinek " + episode;
                }
                string season = getXmlValue(node, "season");
                if (!String.IsNullOrEmpty(season) && season != "0")
                {
                    title += ", sezon " + season;
                }

                string urlQuery = String.Format("&type=episode&id={0}&limit=10&page=1&sort=newest&m=getItem&deviceScreenHeight=1080&deviceScreenWidth=1920",
                                                node.SelectSingleNode("id").InnerText);
                VideoInfo video = new TVNVideoInfo()
                {
                    Title       = title,
                    Description = getXmlValue(node, "lead"),
                    Thumb       = GetIcon(node),
                    VideoUrl    = contentHost + startUrl + urlQuery,
                    Airdate     = getXmlValue(node, "start_date")
                };
                videos.Add(video);
            }
            string nrItems = getXmlValue(doc, "//getItems/count_items");

            Int32.TryParse(nrItems, out videoCount);
            return(videos);
        }
        protected override List<VideoInfo> Parse(string url, string data)
        {
            nextPageUrl = url;
            url = String.Format(url, ++videoPageNr);
            if (data == null)
                data = GetWebData(url);

            List<VideoInfo> videos = new List<VideoInfo>();
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(data);
            foreach (XmlNode node in doc.SelectNodes("//getItems/items/row"))
            {
                string title = node.SelectSingleNode("title").InnerText;
                string episode = getXmlValue(node, "episode");

                if (!String.IsNullOrEmpty(episode) && episode != "0") title += ", odcinek " + episode;
                string season = getXmlValue(node, "season");
                if (!String.IsNullOrEmpty(season) && season != "0") title += ", sezon " + season;

                string urlQuery = String.Format("&type=episode&id={0}&limit=10&page=1&sort=newest&m=getItem&deviceScreenHeight=1080&deviceScreenWidth=1920",
                    node.SelectSingleNode("id").InnerText);
                VideoInfo video = new TVNVideoInfo()
                {
                    Title = title,
                    Description = getXmlValue(node, "lead"),
                    Thumb = GetIcon(node),
                    VideoUrl = contentHost + startUrl + urlQuery,
                    Airdate = getXmlValue(node, "start_date")
                };
                videos.Add(video);
            }
            string nrItems = getXmlValue(doc, "//getItems/count_items");
            Int32.TryParse(nrItems, out videoCount);
            return videos;
        }