Beispiel #1
0
 public RSSReader()
 {
     rssChannel  = new RssChannel();
     imageChanel = new ImageOfChanel();
 }
Beispiel #2
0
        // parses the rss file
        void readFeed(XmlDocument doc)
        {
            // make sure its a valid rss document
            XmlNodeList elements = doc.GetElementsByTagName ("rss");
            if (elements.Count == 0)
            {
                elements = doc.GetElementsByTagName ("rdf");
                if (elements.Count == 0)
                    return;
            }

            // get the rss version
            string rss_version = elements [0].Attributes ["version"].Value;
            switch (rss_version)
            {
                case "0.90":
                    version = RssVersion.RSS090;
                    break;
                case "0.91":
                    version = RssVersion.RSS091;
                    break;
                case "0.92":
                    version = RssVersion.RSS092;
                    break;
                case "1.0":
                    version = RssVersion.RSS10;
                    break;
                case "2.0":
                    version = RssVersion.RSS20;
                    break;
                default:
                    version = RssVersion.NotSupported;
                    break;
            }

            // get the channels
            elements = doc.GetElementsByTagName ("channel");
            if (elements.Count == 0)
                return;

            channel = new RssChannel (elements [0].ChildNodes);
        }