private void SearchSection(string sectionSite, string indexSuffix, ref List<EntryInfo> entries ) { //Well, f**k. This doesn't work for Personals because of that stupid "I'm aware that I could see nudie pics" page. EntryFilter entryFilter = new EntryFilter(); try { if (entryFilter.ParseURL(sectionSite + indexSuffix)) entryFilter.Populate(); } catch (Exception error) { OnPollError(areaDetails.City , error.ToString()); } bool parseMore = true; foreach (EntryInfo entryInfo in entryFilter.EntryList) { if (entryCallbacks.Keys.Contains(entryInfo.URL)) continue; if(!(parseMore = OnEntryFound(entryInfo))) break; entries.Add(entryInfo); BaseBackgroundPoller.EntryParsedHandler eph = null; foreach (BaseBackgroundPoller.EntryParsedHandler _eph in this.aggregatedEntryParsedHandlers.GetInvocationList()) eph += _eph; entryCallbacks.Add(entryInfo.URL, eph); } if (entryFilter.NextHundred != null & parseMore) SearchSection(sectionSite, entryFilter.NextHundred, ref entries); }
private void SearchSection(string sectionSite, string indexSuffix, ref List<string> LastFiveEntriesSearched, ref List<EntryInfo> entries ) { //Well, f**k. This doesn't work for Personals because of that stupid "I'm aware that I could see nudie pics" page. EntryFilter entryFilter = new EntryFilter(); try { if (entryFilter.ParseURL(sectionSite + indexSuffix)) entryFilter.Populate(); } catch (Exception error) { OnPollError(details.City , error.ToString()); } foreach (EntryInfo entryInfo in entryFilter.EntryList) { if (LastFiveEntriesSearched.Count != 0 && LastFiveEntriesSearched.Contains(entryInfo.URL)) { FillLastFive(ref LastFiveEntriesSearched, entryFilter.EntryList); return; } else entries.Add(entryInfo); } if (entryFilter.NextHundred != null) SearchSection(sectionSite, entryFilter.NextHundred, ref LastFiveEntriesSearched, ref entries); else//No more. Fill Last Five FillLastFive(ref LastFiveEntriesSearched, entries); }