Example #1
0
        public List <ParsoCatalog> ParseCatalogList(long batchId, string rootUrl)
        {
            var urlList     = XMLUtil.GetSiteMapUrls(rootUrl);
            var siteMapUrls = urlList.Where(x => x.Contains("katalog-urunleri/")).ToList();

            List <ParsoCatalog> catalogList = new List <ParsoCatalog>();

            foreach (var siteUrl in siteMapUrls)
            {
                var catalogDetail = new ParsoCatalog()
                {
                    Name    = siteUrl.Substring(siteUrl.IndexOf("katalog-urunleri/") + 17, siteUrl.Length - siteUrl.IndexOf("katalog-urunleri/") - 17),
                    RootUrl = rootUrl,
                    Url     = siteUrl,
                    BatchId = batchId
                };

                catalogDetail.Id = SaveCatalog(catalogDetail);
                catalogList.Add(catalogDetail);
            }

            return(catalogList);
        }