Class: Unibanner::Functions
- Inherits:
-
Object
- Object
- Unibanner::Functions
- Defined in:
- lib/unibanner/functions.rb
Overview
A group of functions to help with unibanner
Instance Attribute Summary collapse
-
#key ⇒ String
DNSBL.im key file contents.
Class Method Summary collapse
-
.send2BL(ip) ⇒ Object
Send an IP to the blacklist A bit longer description.
Instance Attribute Details
#key ⇒ String
DNSBL.im key file contents
7 8 9 |
# File 'lib/unibanner/functions.rb', line 7 def key @key end |
Class Method Details
.send2BL(ip) ⇒ Object
Send an IP to the blacklist
A bit longer description.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/unibanner/functions.rb', line 13 def self.send2BL(ip) url = 'https://api.dnsbl.im/import' payload = { key: File.open('/home/ken/.dnsblim-key', 'r').read.chomp!, addresses: [ {type: '5,6', ip: ip, reason: 'fngate and/or unicode spam'} ] } r = Unirest.post(url, parameters: payload.to_json) return r.body end |