Uploaded image for project: 'Apache Roller'
  1. Apache Roller
  2. ROL-934

Filter spiders from dayhits

    XMLWordPrintableJSON

Details

    Description

      At JRoller, we've modified RefererFilter.java to check the user-agent and exclude certain spiders from the dayhits. Our list is currently anything with slurp, bot, or java in the user-agent. It helps to give a much better picture of the actual hits. The following lines were added to RefererFilter around line 77:

      // Check the user agent, just ignore counts for dayhits.
      String useragent = request.getHeader("User-Agent");
      if (useragent != null && !"".equals(useragent) && useragent.indexOf("slurp") != -1 && useragent.indexOf("bot") != -1 && useragent.indexOf("java") != -1) {
      if (mLogger.isDebugEnabled())

      { mLogger.debug("Ignoring request from user agent=" + useragent); }

      } else {

      Attachments

        Activity

          People

            agangolli Anil Gangolli
            mattschmidtjl Matthew Schmidt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: