Beispiel #1
0
        /// <summary>
        /// Loads the OPML file.
        /// </summary>
        /// <param name="opmlPath">The full path to the OPML file.</param>
        /// <returns>The Opml object.</returns>
        public static Opml LoadOpml(string opmlPath)
        {
            if (opmlPath == null)
            {
                throw new ArgumentNullException();
            }
            if (opmlPath == string.Empty)
            {
                throw new ArgumentException();
            }

            OpmlParser parser = new OpmlParser();
            Opml       opml   = parser.Process(opmlPath);

            return(opml);
        }
Beispiel #2
0
        /// <summary>
        /// Subscribes to the RSS feeds supplied in the OPML file.
        /// </summary>
        /// <param name="opmlPath">The full path to the OPML file.</param>
        /// <returns>The Opml object.</returns>
        public static Opml SubscribeOpml(string opmlPath)
        {
            if (opmlPath == null)
            {
                throw new ArgumentNullException();
            }
            if (opmlPath == string.Empty)
            {
                throw new ArgumentException();
            }

            OpmlParser parser = new OpmlParser();

            Opml opml = parser.Process(opmlPath);

            foreach (OpmlItem item in opml.Items)
            {
                FeedEngine.Subscribe(new Uri(item.XmlUrl));
            }

            return(opml);
        }