From 5585e5d92ee960021d16bd336762ddbbc7d78a67 Mon Sep 17 00:00:00 2001 From: Guillaume DOTT Date: Mon, 14 Jan 2013 17:05:52 +0100 Subject: [PATCH] Update README --- README.rdoc | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/README.rdoc b/README.rdoc index 1960425..af6d1dd 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,21 +1,29 @@ = Project Honeypot Project Honeypot is a programmatic interface to the Project Honeypot HTTP:BL service for identifying suspicious ip addresses. -This Gem was built to filter out spammers on http://www.tweetburner.com. It is a handy thing to be able to identify spammers, harvesters, and other suspicious IP addresses if you're worried about who might be abusing your service. -= Requirements +== Requirements This Gem requires that you have an Http:BL API key from Project Honeypot. You can get one at http://projecthhoneypot.org -= Usage +== Configuration + + ProjectHoneypot.configure do + @api_key = 'api_key' + @score = 42 + @last_activity = 10 + @offenses = [:comment_spammer, :suspicious, :harvester] + end + +== Usage HTTP:BL lookups through Project Honeypot result in a Url object that gives you the risk score, last activity, and types of offenses the ip address is listed for. The score is worse the higher it is and the last_activity is in days. -== Example #1: Suspicious IP Address +=== Example #1: Suspicious IP Address Given an api key of "abcdefghijkl" @@ -23,6 +31,9 @@ Given an api key of "abcdefghijkl" @listing.safe? # => false + @listing.safe?(score: 64, last_activity: 10, offenses: [:comment_spammer]) + # => true + @listing.ip_address # => "192.168.1.1" @@ -44,9 +55,12 @@ Given an api key of "abcdefghijkl" @listing.harvester? # => false -== Example #2: Safe IP Address + @listing.search_engine? + # => false - @listing = ProjectHoneypot.lookup("abcdefghijkl", "192.168.1.1") +=== Example #2: Safe IP Address + + @listing = ProjectHoneypot.lookup("192.168.1.1") @listing.safe? # => true @@ -70,9 +84,3 @@ Given an api key of "abcdefghijkl" @listing.harvester? # => false - -= To Do Items - -- Cache Responses from Project Honeypot -- Allow 'safe?' to be configurable (algorithm based on recency and severity(score)) -- A .yml config file