Skip to content

suneet-s/hostbook

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hostbook

This is a Scala library that helps you do GeoIP lookups with the MaxMind GeoIP databases.

import io.imply.hostbook.GeoLookup
import java.io.File

object Example
{
  def main(args: Array[String]) {
    val file = new File("geodb")
    val geo = GeoLookup.fromFreeDownloadableDatabase(file)
    val result = geo.lookup("206.190.36.45")
    println(s"IP is from ${result.cityName.orNull}, ${result.regionName.orNull}, ${result.countryName.orNull}.")
  }
}

About

Scala GeoIP lookups

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 100.0%