/scala-crawler-detect

Scala port of Crawler-Detect

Primary LanguageScala

Purpose

This library will identify bot based on user agents. It does this using regex defined in src/main/resources/crawler_regex_list.txt.

This is based on/a port of Crawler-Detect.

Testing

Run sbt test.

Compiling

Simply run sbt package.

Add with SBT

sbt publishLocal

In build.sbt

libraryDependencies += "com.eventbrite" %% "scala-crawler-detect" % "1.0"

Usage

Using the isCrawler method will return a Boolean. Before checking this the user agent is cleaned up to prevent false positives.

import com.eventbrite.datafoundry.CrawlerDetect

val cd = new CrawlerDetect
val userAgent: String = ???
cd.isCrawler(userAgent)