Exemplo n.º 1
0
        public static string getTitle(int seriesID, int season, int episode)
        {
            string newTitle = null;

            try
            {
                if (season < 100)
                {
                    string seporater = "x0";
                    if (episode > 10)
                    {
                        seporater = "x";
                    }
                    XDocument EpisodeList = XDocument.Load("http://services.tvrage.com/feeds/episodeinfo.php?sid=" + seriesID.ToString() + "&ep=" + season.ToString() + seporater + episode.ToString());

                    var Categorys = from Episode in EpisodeList.Descendants("episode")
                                    select new
                    {
                        Title = Episode.Element("title").Value,
                    };

                    foreach (var wd in Categorys)
                    {
                        newTitle = wd.Title;
                    }
                }
                //newTitle = ;
            }
            catch (Exception) { }

            if (newTitle == null)
            {
                return("");
            }
            newTitle = newTitle.Replace(":", "").Replace("?", "").Replace("/", "").Replace("<", "").Replace(">", "").Replace("\\", "").Replace("*", "").Replace("|", "").Replace("\"", "");
            return(newTitle);
        }