<commit_before>= 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

This Gem requires that you have an Http:BL API key from Project Honeypot. You can get one at http://projecthhoneypot.org

= 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

Given an api key of "<KEY>"

  @listing = ProjectHoneypot.lookup("abcdefghijkl", "192.168.1.1")
  @listing.safe?
  # => false

  @listing.ip_address
  # => "192.168.1.1"

  @listing.score
  # => 63

  @listing.last_activity
  # => 1

  @listing.offenses
  # => [:comment_spammer, :suspicious]

  @listing.comment_spammer?
  # => true

  @listing.suspicious?
  # => true

  @listing.harvester?
  # => false

== Example #2: Safe IP Address

  @listing = ProjectHoneypot.lookup("abcdefghijkl", "192.168.1.1")
  @listing.safe?
  # => true

  @listing.ip_address
  # => "192.168.1.1"

  @listing.score
  # => 0

  @listing.last_activity
  # => nil

  @listing.offenses
  # => []

  @listing.comment_spammer?
  # => false

  @listing.suspicious?
  # => false

  @listing.harvester?
  # => false


<commit_msg>added todos to readme file<commit_after>= 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

This Gem requires that you have an Http:BL API key from Project Honeypot. You can get one at http://projecthhoneypot.org

= 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

Given an api key of "<KEY>"

  @listing = ProjectHoneypot.lookup("abcdefghijkl", "192.168.1.1")
  @listing.safe?
  # => false

  @listing.ip_address
  # => "192.168.1.1"

  @listing.score
  # => 63

  @listing.last_activity
  # => 1

  @listing.offenses
  # => [:comment_spammer, :suspicious]

  @listing.comment_spammer?
  # => true

  @listing.suspicious?
  # => true

  @listing.harvester?
  # => false

== Example #2: Safe IP Address

  @listing = ProjectHoneypot.lookup("abcdefghijkl", "192.168.1.1")
  @listing.safe?
  # => true

  @listing.ip_address
  # => "192.168.1.1"

  @listing.score
  # => 0

  @listing.last_activity
  # => nil

  @listing.offenses
  # => []

  @listing.comment_spammer?
  # => false

  @listing.suspicious?
  # => false

  @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

{'fraction_non_alphanumeric': 0.1045828437132785, 'fraction_numerical': 0.022326674500587545, 'mean_word_length': 3.6013513513513513, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 8, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3889910', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1072, 'n_words': 375}