Beispiel #1
0
        private async Task <string> GetRawPage(ImmoXXLWebClientOptions options, int page)
        {
            var cursor = page * PageItemCount;

            return(await _client.GetStringAsync(
                       $"{options.BaseUrl}/index.php4?cmd=searchResults&alias=suchmaske&kaufartids={options.BuyIds}&kategorieids={options.CategoryIds}&objq[cursor]={cursor}"));
        }
Beispiel #2
0
        public async Task <IEnumerable <ImmoXXLImmoProperty> > GetObjects(ImmoXXLWebClientOptions options)
        {
            List <ImmoXXLImmoProperty> pageProperties;
            List <ImmoXXLImmoProperty> allProperties = new List <ImmoXXLImmoProperty>();
            var currentPage = 0;

            do
            {
                var page = await GetRawPage(options, currentPage ++);

                pageProperties = ParseRawPage(page, options.BaseUrl).ToList();
                allProperties.AddRange(pageProperties);
            } while (pageProperties.Count != 0);

            return(allProperties);
        }