public static IObservable <PageQR> GetPagesQR(PageRequest request, int maxPages = 100) { PageQR startPage = new PageQR(request, null); IObservable <PageQR> pages = Observable.Range(1, maxPages) .Scan(startPage, (acc, num) => GetPageQR(acc, num)) .TakeWhile(page => page.Response.MaxModif != null); return(pages); }
private static PageQR GetPageQR(PageQR prevPage, int num) { PageRequest prevRequest = prevPage.Request; DateTime? lastModif = prevPage.Response?.MaxModif ?? prevRequest.ModifAfter; PageRequest request = prevRequest.CloneWith(lastModif); PageResponse response = WebClient.GetPageResponse(request, num); PageQR page = new PageQR(request, response); return(page); }
private static PageRequest WriteToFile(PageQR page) { //TODO return(page.Request); }