示例#1
0
        public ThriftServer(string ipAddress, int port)
        {
            IpAddress = ipAddress;
            Port      = port;

            JSONManager manager = new JSONManager(VkusotiikiCrawler.JSON_FILE_PATH);

            _recipes = manager.ReadRecipes();
        }
        public void RunCrawler()
        {
            int         initialRecipesCount = Recipes.Count();
            JSONManager manager             = new JSONManager(JSON_FILE_PATH);

            Recipes = manager.ReadRecipes();
            InitiateCrawler();
            StartCrawler();
            _recipesFixer.FixRecipes(Recipes);
            _recipesFixer.TrimRecipes(Recipes);
            if (initialRecipesCount != Recipes.Count())
            {
                manager.WriteRecipes(Recipes);
            }
        }