<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -29,6 +29,7 @@ namespace :app do
       puts &quot;* Creating data directory in &quot; + Marley::DATA_DIRECTORY
       FileUtils.mkdir_p( Marley::DATA_DIRECTORY )
     end
+    desc &quot;Create database for comments&quot;
     task :create_database_for_comments do
       puts &quot;* Creating comments SQLite database in #{Marley::DATA_DIRECTORY}/comments.db&quot;
       ActiveRecord::Base.establish_connection( :adapter =&gt; 'sqlite3', </diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ require 'yaml'             # ... use YAML for configs and stuff ...
 require 'sinatra'          # ... Classy web-development dressed in DSL, http://sinatrarb.heroku.com
 require 'activerecord'     # ... or Datamapper? What? :)
 require 'rdiscount'        # ... convert Markdown into HTML in blazing speed
-require File.join(File.dirname(__FILE__), '..', 'vendor', 'antispammer') # ... disable comment spam
+require File.join(File.dirname(__FILE__), '..', 'vendor', 'akismetor')   # ... disable comment spam
 require File.join(File.dirname(__FILE__), '..', 'vendor', 'githubber')   # ... get repo info
 
 # ... or alternatively, run Sinatra on edge ...
@@ -104,7 +104,12 @@ end
 post '/:post_id/comments' do
   @post = Marley::Post[ params[:post_id] ]
   throw :halt, [404, not_found ] unless @post
-  params.merge!( { :ip =&gt; request.env['REMOTE_ADDR'], :user_agent =&gt; request.env['HTTP_USER_AGENT'] } )
+  params.merge!( {
+      :ip         =&gt; request.env['REMOTE_ADDR'].to_s,
+      :user_agent =&gt; request.env['HTTP_USER_AGENT'].to_s,
+      :referrer   =&gt; request.env['REFERER'].to_s,
+      :permalink  =&gt; &quot;#{hostname}#{@post.permalink}&quot;
+  } )
   # puts params.inspect
   @comment = Marley::Comment.create( params )
   if @comment.valid?</diff>
      <filename>app/marley.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,10 +17,13 @@ module Marley
     # See http://railscasts.com/episodes/65-stopping-spam-with-akismet
     def akismet_attributes
       {
-        :key                  =&gt; CONFIG['typekey_antispam']['key'],
-        :blog                 =&gt; CONFIG['typekey_antispam']['url'],
+        :key                  =&gt; CONFIG['akismet']['key'],
+        :blog                 =&gt; CONFIG['akismet']['url'],
         :user_ip              =&gt; self.ip,
         :user_agent           =&gt; self.user_agent,
+        :referrer             =&gt; self.referrer,
+        :permalink            =&gt; self.permalink,
+        :comment_type         =&gt; 'comment',
         :comment_author       =&gt; self.author,
         :comment_author_email =&gt; self.email,
         :comment_author_url   =&gt; self.url,
@@ -30,7 +33,7 @@ module Marley
     
     def check_spam
       self.checked = true
-      self.spam = !::Antispammer.spam?(akismet_attributes)
+      self.spam = Akismetor.spam?(akismet_attributes)
       true # return true so it doesn't stop save
     end
 </diff>
      <filename>app/marley/comment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -34,6 +34,10 @@ module Marley
     def categories
       self.meta['categories'] if self.meta and self.meta['categories']
     end
+
+    def permalink
+      &quot;/#{id}.html&quot;
+    end
             
     private
     </diff>
      <filename>app/marley/post.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@ module Marley
 end
 
 # &quot;Stub&quot; anti-spam library
-class Antispammer
+class Akismetor
   def self.spam?(attributes)
     rand &gt; 0.5 ? true : false
   end</diff>
      <filename>app/test/marley_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@
 ActiveRecord::Schema.define(:version =&gt; 1) do
   create_table :comments do |t|
     t.string :post_id, :null =&gt; false
-    t.string :author, :email, :url, :ip, :referrer , :user_agent
+    t.string :author, :email, :url, :ip, :referrer , :user_agent, :referrer, :permalink, :comment_type
     t.text   :body
     t.datetime :created_at, :default =&gt; 'NOW()'
     t.boolean  :checked, :default =&gt; false</diff>
      <filename>config/db_create_comments.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@ class Akismetor
   # Does a comment-check on Akismet with the submitted hash.
   # Returns true or false depending on response.
   def self.spam?(attributes)
-    self.new(attributes).execute('comment-check') != &quot;false&quot;
+    self.new(attributes).execute('comment-check') == &quot;true&quot;
   end
   
   # Does a submit-spam on Akismet with the submitted hash.
@@ -39,7 +39,7 @@ private
   
   def http_headers
     {
-      'User-Agent' =&gt; 'Akismetor Merb Library/1.0',
+      'User-Agent' =&gt; 'Akismetor Ruby Library/1.0',
       'Content-Type' =&gt; 'application/x-www-form-urlencoded'
     }
   end
@@ -48,4 +48,4 @@ private
     result = attributes.map { |k, v| &quot;#{k}=#{v}&quot; }.join('&amp;')
     URI.escape(result)
   end
-end
\ No newline at end of file
+end</diff>
      <filename>vendor/akismetor.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b6de7ceb85e04fafd234149cc7cb59189b72dd27</id>
    </parent>
  </parents>
  <author>
    <name>Karel Minarik</name>
    <email>karmi@karmi.cz</email>
  </author>
  <url>http://github.com/lukeredpath/marley/commit/33eedf86d5a6a87aeb1960ffcfccd60bdfddd41d</url>
  <id>33eedf86d5a6a87aeb1960ffcfccd60bdfddd41d</id>
  <committed-date>2008-11-28T04:04:03-08:00</committed-date>
  <authored-date>2008-11-28T04:04:03-08:00</authored-date>
  <message>Make spam blocking with Akismet actually work. (You really must send all those fields :) IMPORTANT: You must upgrade your comments.db schema for this to work -- check commit message below.

*&#160;Implemented Akismet spam blocking

* Changed comments table schema to reflect this. You must change your schema with the following

		$sqlite3 /where/you/have/comments.db
		sqlite&gt; ALTER TABLE comments ADD referrer varchar(255);
		sqlite&gt; ALTER TABLE comments ADD permalink varchar(255);
		sqlite&gt; ALTER TABLE comments ADD comment_type varchar(255);
		sqlite&gt; .quit

and you are done. Or just delete the comments.db in your installation and run Rake task `rake app:install:create_database_for_comments`</message>
  <tree>56d286f1736c8dd9e46a9736aa413fc16ac32648</tree>
  <committer>
    <name>Karel Minarik</name>
    <email>karmi@karmi.cz</email>
  </committer>
</commit>
