Beispiel #1
0
        // Pytanie, czym się różni funcja Feeds() od xmel(), mam wrażenie że obie realizują to samo zadanie.
        public static string Feeds()
        {
            var reader = new FeedReader();
            // Docelowo dane zaczytywane od użytkownika
            var    items = reader.RetrieveFeed("http://www.nytimes.com/services/xml/rss/nyt/International.xml");
            string feeds = "";

            foreach (var i in items)
            {
                var x = (string.Format("{0}\t{1}",
                                       i.Date.ToString("g"),
                                       i.Title)
                         );
                feeds += x + "\n";
            }
            return(feeds);
        }
Beispiel #2
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            // var posts = new Reader().ReadFeed(@"http://www.nytimes.com/services/xml/rss/nyt/International.xml");
            // Console.WriteLine(posts.ToList().Count);
            //  Console.ReadLine();
            //  FeedBox.Text = posts.ToList().ToString();
            //test

            var    reader = new FeedReader();
            var    items  = reader.RetrieveFeed("http://www.nytimes.com/services/xml/rss/nyt/International.xml");
            string feeds  = "";

            foreach (var i in items)
            {
                var x = (string.Format("{0}\t{1}",
                                       i.Date.ToString("g"),
                                       i.Title)

                         );
                feeds += x + "\n";
            }
            FeedBox.Text = feeds;
        }