Collection<CrawlResultPackage> aResultColl =aCrawl.crawlWebPages(aUrl, 5000);
logger.debug("aResultColl Size=" + aResultColl.size());
// 3. Create analyzer object
AnaCrack aAnaCrack = new AnaCrack();
// 4. do the anlysing and return the offers
Collection<CrawlResultPackage> aAnaColl = aAnaCrack.analyse(
aResultColl, /* The result collection from the crawler */
50, /* Give me the x best offers */
CraigslistAlgorithmEnum.BEST, /* To use algorithm */
1, /* Lower control limit */
1000 /* higher control limit */
);
int i = 0;
for (CrawlResultPackage aPack : aAnaColl) {
i++;
logger.debug(i + ". BEST OFFERS=" + aPack.toString());
}
Collection<LocationDistribution> aLocColl=aAnaCrack.getLocationDistribution();
i = 0;
for (LocationDistribution aLoc : aLocColl) {
i++;
logger.info(aLoc.toString());
}
logger.info(aLocColl.size());
Collection<PriceDistribution> aPriceColl=aAnaCrack.getPriceDistribution();
i = 0;
for (PriceDistribution aPrice : aPriceColl) {
i++;
logger.debug(aPrice.toString());