示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
 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");
     }
 }
示例#4
0
        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);
        }