iab-spiders-and-robots-client

Snowplow Java client library for the IAB and ABC International Spiders and Robots lists.

License

License

Categories

Categories

IDE Development Tools CLI User Interface
GroupId

GroupId

com.snowplowanalytics
ArtifactId

ArtifactId

iab-spiders-and-robots-client
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

iab-spiders-and-robots-client
Snowplow Java client library for the IAB and ABC International Spiders and Robots lists.
Project URL

Project URL

https://github.com/snowplow/iab-spiders-and-robots-java-client/
Project Organization

Project Organization

com.snowplowanalytics
Source Code Management

Source Code Management

https://github.com/snowplow/iab-spiders-and-robots-java-client

Download iab-spiders-and-robots-client

How to add to project

<!-- https://jarcasting.com/artifacts/com.snowplowanalytics/iab-spiders-and-robots-client/ -->
<dependency>
    <groupId>com.snowplowanalytics</groupId>
    <artifactId>iab-spiders-and-robots-client</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.snowplowanalytics/iab-spiders-and-robots-client/
implementation 'com.snowplowanalytics:iab-spiders-and-robots-client:0.2.0'
// https://jarcasting.com/artifacts/com.snowplowanalytics/iab-spiders-and-robots-client/
implementation ("com.snowplowanalytics:iab-spiders-and-robots-client:0.2.0")
'com.snowplowanalytics:iab-spiders-and-robots-client:jar:0.2.0'
<dependency org="com.snowplowanalytics" name="iab-spiders-and-robots-client" rev="0.2.0">
  <artifact name="iab-spiders-and-robots-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.snowplowanalytics', module='iab-spiders-and-robots-client', version='0.2.0')
)
libraryDependencies += "com.snowplowanalytics" % "iab-spiders-and-robots-client" % "0.2.0"
[com.snowplowanalytics/iab-spiders-and-robots-client "0.2.0"]

Dependencies

compile (4)

Group / Artifact Type Version
org.apache.commons : commons-lang3 jar 3.5
org.apache.commons : commons-csv jar 1.4
commons-io : commons-io jar 2.5
com.github.seancfoley : ipaddress jar 5.3.1

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.assertj : assertj-core jar 2.6.0

Project Modules

There are no modules declared in this project.

IAB Spiders And Robots Java Client

Build Status Release License

This is a Java 8 client library for the IAB/ABC International Spiders and Bots List (available separately).

The library is available from Maven Central, and is published under the Apache 2.0 License.

It uses Gradle as its build tool and contains a comprehensive set of JUnit tests.

Installation

Add into your project's pom.xml:

<dependency>
    <groupId>com.snowplowanalytics</groupId>
    <artifactId>iab-spiders-and-robots-client</artifactId>
    <version>0.2.0</version>
</dependency>

A Simple Example

Assume we have a HTTP request from the IP address: 128.101.101.101 with a user agent string: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:50.0) Gecko/20100101 Firefox/50.0. To perform a robot or spider check using this algorithm:

// A File object pointing to your ip_exclude_current_cidr.txt file
File ipFile = new File("/path/to/ip_exclude_current_cidr.txt");

// File objects pointing to your include and exclude lists
File excludeUaFile = new File("/path/to/exclude_current.txt");
File includeUaFile = new File("/path/to/include_current.txt");

// This creates the IabClient object, which should be reused across lookups.
IabClient client = new IabClient(ipFile, excludeUaFile, includeUaFile);

String useragent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:50.0) Gecko/20100101 Firefox/50.0";
InetAddress ipAddress = InetAddress.getByName("128.101.101.101");
IabResponse iabResponse = client.check(useragent, ipAddress);

For more complex examples and step by step description, please, refer the library Wiki: Usage Of The Library

Quickstart

Assuming git, Vagrant and VirtualBox installed:

host$ git clone https://github.com/snowplow/iab-spiders-and-robots-java-client.git
host$ cd iab-spiders-and-robots-java-client
host$ vagrant up && vagrant ssh
guest$ cd /vagrant
guest$ ./gradlew clean build
guest$ ./gradlew test

Find out more

Copyright and License

IAB Spiders And Robots Java Client is copyright 2017-2020 Snowplow Analytics Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

com.snowplowanalytics

Snowplow Analytics

Versions

Version
0.2.0
0.2.0-M2
0.2.0-M1
0.1.0
0.1.0-rc1