Examples of Crawler


Examples of com.crawl.control.Crawler

    @Test
    public void test_MatchPatternCompareLength() {
        logger.debug("Test MatchPattern... compare length");
       
        // 1. Create the crawler object
        Crawler aCrawl = Crawler.getInstance();

        String aUrl=aCrawl.createUrl(
                CraigslistCategoryEnum.FOR_SALE__COMPUTER,
                CraigslistAreasEnum.PENINSULA,
                "Apple");
              
        Collection<CrawlResultPackage> aCrawlResultColl=aCrawl.crawlWebPages(aUrl, 100);

        String aString=aCrawl.getMatchPattern();
       
        logger.info("MatchPatter="+aString+" length="+aString.length());
       
        assertTrue(aString.length()==43);
    }
View Full Code Here

Examples of com.crawl.control.Crawler

    @Test
    public void test_url1() {
        logger.debug("Test url 1");
       
        // 1. Create the crawler object
        Crawler aCrawl = Crawler.getInstance();

        String aUrl=aCrawl.createUrl(
                CraigslistCategoryEnum.FOR_SALE__COMPUTER,
                CraigslistAreasEnum.PENINSULA,
                "Apple");
              
        Collection<CrawlResultPackage> aCrawlResultColl=aCrawl.crawlWebPages(aUrl, 100);
       
        logger.info("URL="+aUrl+" length="+aUrl.length());
       
        assertTrue(aUrl != null);
    }
View Full Code Here

Examples of com.crawl.control.Crawler

    @Test
    public void test_url2() {
        logger.debug("Test url 2...");
       
        // 1. Create the crawler object
        Crawler aCrawl = Crawler.getInstance();

        String aUrl=aCrawl.createUrl(
                CraigslistCategoryEnum.FOR_SALE__COMPUTER,
                CraigslistAreasEnum.PENINSULA,
                "Apple");
              
        Collection<CrawlResultPackage> aCrawlResultColl=aCrawl.crawlWebPages(aUrl, 100);
       
        logger.info("URL="+aUrl+" length="+aUrl.length());
       
        assertTrue(aUrl.compareTo("http://sfbay.craigslist.org/search/sya/pen?query=Apple&maxAsk=100000&sort=pricedsc&srchType=A&s=") ==0);   
    }
View Full Code Here

Examples of com.crawl.control.Crawler

    @Test
    public void test_url3() {
        logger.debug("Test url 3...");
       
        // 1. Create the crawler object
        Crawler aCrawl = Crawler.getInstance();

        String aUrl=aCrawl.createUrl(
                CraigslistCategoryEnum.FOR_SALE__COMPUTER,
                CraigslistAreasEnum.PENINSULA,
                "Apple");
              
        Collection<CrawlResultPackage> aCrawlResultColl=aCrawl.crawlWebPages(aUrl, 100);
               
        logger.debug("URL="+aUrl+" length="+aUrl.length());
       
        assertTrue(aUrl.length()==96);   
    }
View Full Code Here

Examples of com.crawljax.core.Crawler

    action = candidateActions.pollFirst();
    if (action != null) {
      workInProgressCandidateActions.put(requestingCrawler, action);
      return action;
    } else {
      Crawler c = registeredCrawlers.pollFirst();
      if (c == null) {
        return null;
      }
      do {
        if (manager.removeWorkFromQueue(c)) {
View Full Code Here

Examples of com.crawljax.core.Crawler

    action = candidateActions.pollFirst();
    if (action != null) {
      workInProgressCandidateActions.put(requestingCrawler, action);
      return action;
    } else {
      Crawler c = registeredCrawlers.pollFirst();
      if (c == null) {
        return null;
      }
      do {
        if (manager.removeWorkFromQueue(c)) {
View Full Code Here

Examples of com.crawljax.core.Crawler

    action = candidateActions.pollFirst();
    if (action != null) {
      workInProgressCandidateActions.put(requestingCrawler, action);
      return action;
    } else {
      Crawler c = registeredCrawlers.pollFirst();
      if (c == null) {
        return null;
      }
      do {
        if (manager.removeWorkFromQueue(c)) {
View Full Code Here

Examples of crawler.Crawler

     */
    public Crawler getCrawler(String crawlerId)
    {
        for (int i = 0; i < crawlers.size(); i++)
        {
            Crawler crawler = crawlers.get(i);
            String id = crawler.getCrawlerId();
            if (crawlerId.equals(id))
            {
                Crawler newCrawler = componentContext.getService(Crawler.class, "crawlers");
                return newCrawler;
            }
        }
        throw new RuntimeException("No crawler with id " + crawlerId + " found");
    }
View Full Code Here

Examples of net.sf.regain.crawler.Crawler

   * @param shouldPause Whether the crawler should pause.
   */
  public void setShouldPause(boolean shouldPause) {
    // NOTE: We get a local copy of the crawler for the case that is should
    //       change in the meantime
    Crawler crawler = mCrawler;
    if (crawler != null) {
      crawler.setShouldPause(shouldPause);
      TrayIconHandler.getInstance().setIndexUpdateRunning(! shouldPause);
    }
  }
View Full Code Here

Examples of net.sf.regain.crawler.Crawler

        // Create and run the crawler
        TrayIconHandler.getInstance().setIndexUpdateRunning(true);
        try {
          mLog.info("Starting index update on " + new Date());
          mCrawler = new Crawler(config, authProps);
          mCrawler.run(true, false, null);
        }
        catch (RegainException exc) {
          mLog.error("Updating the index failed", exc);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.