About Statistics

We keep a running count of the number of "spam" and "ok" comments that pass through this server:

  • Globally.
  • For each site uses this service.

When submitting a comment for testing the mandatory site-parameter is used to identify your site, i.e. the site upon which the comment has been left.

If you ever wish to retrieve the count of spam/ok comments we've processed you can use that same site-data to retrieve your comment counts.

Retrieving Site Statistics

To retrieve your site statitics POST a JSON-encoded hash which contains the member site. The site must match the site you use when you test comments, otherwise no data will be found.

Here is a simple Ruby example:

#!/usr/bin/ruby

require 'net/http'
require 'json'

# the hash we'll send
str = {:site => "http://blog.steve.org.uk/" }.to_json;

# The URL we'll submit to.
uri   = URI.parse("http://test.blogspam.net:9999/stats")

# Create the post body, for the host.
http = Net::HTTP.new(uri.host,uri.port)
req  = Net::HTTP::Post.new(uri.path, initheader = {'Content-Type' =>'application/json'})
req.body = str

# send the request
res = http.request(req)

# Show the output
puts res.body

Running this shows that my blog has currently submitted 2109 comments which were judged to be SPAM:

$ ruby stats.rb
{"spam":"2109","ok":"745"}