0.0
No release in over 3 years
Low commit activity in last 3 years
AbuseIPDB is a project dedicated to helping combat the spread of hackers, spammers, and abusive activity on the internet.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.16, ~> 2.0
~> 12.3, >= 12.3.3
~> 3.0
>= 4.0.0, ~> 4.0

Runtime

~> 0.15, >= 0.15.2
>= 0.12.2, ~> 0.13
 Project Readme

Abuseipdb::Rb

Gem Version Build Status

A Ruby client gem for the AbuseIPDB service API

Branch AbuseIPDB API
Master v2

Installation

Add this line to your application's Gemfile:

gem 'abuseipdb-rb'

And then execute:

$ bundle

Or install it yourself as:

$ gem install abuseipdb-rb

Usage

First set up configurations (Ex. for rails apps into config/initializers)

Abuseipdb.configure do |config|
    config.api_key = "YOUR_ABUSEIPDB_API_KEY"
    config.timeout = 20 # Default is 60s
end

Then just init a client an use it

client = Abuseipdb.client

# CHECK Endpoint
response = client.check.call(ipAddress: '8.8.8.8')

response.status
    => 200
response.body
    => {"data"=>{"ipAddress"=>"8.8.8.8", "isPublic"=>true, 
        "ipVersion"=>4, "isWhitelisted"=>true, "abuseConfidenceScore"=>0, 
        "countryCode"=>"US", "usageType"=>"Data Center/Web Hosting/Transit", 
        "isp"=>"Google LLC", "domain"=>"google.com", "totalReports"=>16, 
        "lastReportedAt"=>"2019-06-12T01:09:53+01:00"}}

Current Endpoints

Command Endpoint
client = Abuseipdb.client Init a client
client.check.call https://api.abuseipdb.com/api/v2/check
client.blacklist.call https://api.abuseipdb.com/api/v2/blacklist
client.check_block.call https://api.abuseipdb.com/api/v2/check-block
client.report.call https://api.abuseipdb.com/api/v2/report

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Report issues / feature requests and pull requests are welcome. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Thanks

License

The gem is available as open source under the terms of the MIT License.