Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 1.03 KB

README.md

File metadata and controls

38 lines (27 loc) · 1.03 KB

Maven Central Build Status

http:BL API in Scala

"http:BL" API is similar to DNSBL, but for web traffic rather than mail traffic. The specification is here

Using

In SBT:

libraryDependencies += "com.osinka.httpbl" %% "httpbl" % "2.0.0"

In your code:

import com.osinka.httpbl._

val api = HttpBL(accessKey)

val response = api("127.0.0.1")
response match {
  case Some(found @ HttpBL.Result) =>
    found.isSuspicious
    found.isHarvester
    found.isCommentSpammer
    found.days   // how many days ago this IP has been seen
    found.threat // threat level

  case Some(searchEngine @ HttpBL.SearchEngine) =>
    searchEngine.serial == SearchEngines.Google

  case None =>
    // not found
}