예제 #1
0
        private void FetchNewFeeds()
        {
            // Get all the items from the database
            List <Item>  currentItems = BasicRepository.AllItems();
            IList <Feed> feeds        = BasicRepository.AllFeeds();
            FeedFetcher  fetcher      = new FeedFetcher(_settings, currentItems);

            // Fetch each one
            List <Item> newItems = new List <Item>();

            foreach (Feed feed in feeds)
            {
                newItems.AddRange(fetcher.Parse(feed));
                Console.WriteLine("Finished {0}", feed.Url);
            }

            if (newItems.Count > 0)
            {
                SaveToDatabase(newItems);
            }
        }
예제 #2
0
        private void FetchNewFeeds()
        {
            // Get all the items from the database
            List<Item> currentItems = BasicRepository.AllItems();
            IList<Feed> feeds = BasicRepository.AllFeeds();
            FeedFetcher fetcher = new FeedFetcher(_settings, currentItems);

            // Fetch each one
            List<Item> newItems = new List<Item>();
            foreach (Feed feed in feeds)
            {
                newItems.AddRange(fetcher.Parse(feed));
                Console.WriteLine("Finished {0}", feed.Url);
            }

            if (newItems.Count > 0)
            {
                SaveToDatabase(newItems);
            }
        }