コード例 #1
0
        private static void GetData(object obj)
        {
            var allItems      = AllItemDownloader.DownloadItems();
            var allItemOffers = new Dictionary <string, Tuple <DateTime, ItemOffers> >();

            var time = DateTime.Now;
            int i    = 1;

            foreach (var item in allItems)
            {
                allItemOffers.Add(item.item_name, DownloadOffers(item));
                Console.WriteLine($"Downloaded item {i}: {item.item_name}");
                i++;
            }

            var latestTime = DateTime.Now - time;

            Console.WriteLine($"Download took {latestTime.Minutes}:{latestTime.Seconds}");

            SaveModel.UploadSnapshot(allItemOffers, _mongoUsername, _mongoPass);
        }