public static List <string> GetEpisodes(string name) { SyndicationFeed feed = XMLPodcastHandler.ReadFromXML(name); List <string> ListOfEpisodes = new List <string>(); foreach (SyndicationItem item in feed.Items) { ListOfEpisodes.Add(item.Title.Text); } return(ListOfEpisodes); }
public static string[] GetPodcast(string url, string Kategori, int TimerIndex) { XmlReader reader = XmlReader.Create(url); SyndicationFeed feed = SyndicationFeed.Load(reader); reader.Close(); XMLPodcastHandler.WriteToXML(feed, Kategori, TimerIndex, url); string[] arrOfPodInfo = new string[2]; arrOfPodInfo[0] = feed.Title.Text; arrOfPodInfo[1] = feed.Items.Count().ToString(); return(arrOfPodInfo); }
public static string GetEpisodeInfo(string PodName, string EpisodeName) { try { SyndicationFeed feed = XMLPodcastHandler.ReadFromXML(PodName); foreach (var item in feed.Items) { string PodContent = item.Title.Text; if (PodContent == EpisodeName) { var input = item.Summary.Text.ToString(); var output = Regex.Replace(input, "<.*?>", String.Empty); return(output); } } return("Ingen information finns"); } catch (Exception) { return("Ingen information"); } }
public static string[] GetPodcast(string Name) { SyndicationFeed feed = XMLPodcastHandler.ReadFromXML(Name); StreamReader reader = new StreamReader(@"Database//" + "KoT$" + Name + ".txt"); string Content = reader.ReadToEnd(); reader.Close(); var SplitOn = new string[] { "\r\n" }; string[] KategoriOchTimer = Content.Split(SplitOn, StringSplitOptions.None); string[] arrOfPodInfo = new string[4]; arrOfPodInfo[0] = feed.Title.Text; arrOfPodInfo[1] = feed.Items.Count().ToString(); if (Int32.Parse(KategoriOchTimer[1]) > 100) { arrOfPodInfo[2] = (Int32.Parse(KategoriOchTimer[1]) / 1000 / 60).ToString(); } else { arrOfPodInfo[2] = KategoriOchTimer[1]; } arrOfPodInfo[3] = KategoriOchTimer[0]; return(arrOfPodInfo); }