public
Fork of halorgium/mephisto
Description: A refactored Mephisto that has multiple spam detection engines.
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/francois/mephisto.git
The Admin::Settings#index page now shows statistics for the selected 
engine.

Defensio has nice graphs, using the Google Charts API.
francois (author)
Mon Mar 03 09:08:57 -0800 2008
commit  5163842ab6683f912b5bb856eacf6a7f9e6260f6
tree    5bbeaeff360d2c052257287484a5589567c35ceb
parent  a80561b04d2f058c3f5bb5d8407454a83fb357d3
...
4
5
6
 
7
8
9
...
59
60
61
 
 
 
 
 
 
62
63
64
...
4
5
6
7
8
9
10
...
60
61
62
63
64
65
66
67
68
69
70
71
0
@@ -4,6 +4,7 @@
0
   <ul id="act-nav" class="clear">
0
     <li><%= link_to "General", '#general' %></li>
0
     <li><%= link_to "Spam Prevention", '#spam' %></li>
0
+ <li><%= link_to "Spam Statistics", '#spam-statistics' %></li>
0
     <li><%= link_to "Comments", '#spam' %></li>
0
     <li><%= link_to "Publishing", '#publish' %></li>
0
     <% if ActionController::Base.perform_caching -%>
0
@@ -59,6 +60,12 @@
0
   </div>
0
 </div>
0
 
0
+<div id="spam-statistics" class="setgroup">
0
+ <h3>Spam Statistics</h3>
0
+
0
+ <%= @site.spam_engine.statistics_template %>
0
+</div>
0
+
0
 <div id="publish" class="setgroup">
0
   <h3>Publishing and Reading</h3>
0
   <dl class="setform">
...
31
32
33
 
 
 
 
 
 
34
35
36
...
31
32
33
34
35
36
37
38
39
40
41
42
0
@@ -31,6 +31,12 @@ module Mephisto
0
         false
0
       end
0
 
0
+ # Returns a fully formed HTML fragment that renders statistics on this
0
+ # engine's performance.
0
+ def statistics_template
0
+ raise SubclassResponsibilityError
0
+ end
0
+
0
       # Announces a new article was created.
0
       def announce_article(permalink_url, article)
0
         raise SubclassResponsibilityError
...
9
10
11
 
 
 
 
12
13
14
...
9
10
11
12
13
14
15
16
17
18
0
@@ -9,6 +9,10 @@ module Mephisto
0
         end
0
       end
0
 
0
+ def statistics_template
0
+ "<p>The Akismet API does not extract statistics about it's performance.</p>"
0
+ end
0
+
0
       # Akismet doesn't care about real articles.
0
       def announce_article(permalink_url, article)
0
       end
...
17
18
19
 
 
 
 
20
21
22
...
57
58
59
60
61
62
63
64
65
66
...
17
18
19
20
21
22
23
24
25
26
...
61
62
63
 
 
 
 
64
65
66
0
@@ -17,6 +17,10 @@ module Mephisto
0
         self.validate_key.success?
0
       end
0
 
0
+ def statistics_template
0
+ self.class.load_template(File.join(File.dirname(__FILE__), "defensio_statistics.html.erb")).render(:site => site, :options => site.spam_engine_options, :statistics => defensio.get_stats)
0
+ end
0
+
0
       def announce_article(permalink_url, article)
0
         response = defensio.announce_article(
0
           :article_author => article.updater.login,
0
@@ -57,10 +61,6 @@ module Mephisto
0
         defensio.report_false_negatives(:signatures => [comment.spam_engine_data[:signature]])
0
       end
0
 
0
- # The Defensio service supports statistics.
0
- def statistics
0
- end
0
-
0
       def errors
0
         returning([]) do |es|
0
           es << "The Defensio key is missing" if options[:defensio_key].blank?
...
13
14
15
 
 
 
 
16
17
18
...
13
14
15
16
17
18
19
20
21
22
0
@@ -13,6 +13,10 @@ module Mephisto
0
         true
0
       end
0
 
0
+ def statistics_template
0
+ ""
0
+ end
0
+
0
       def announce_article(permalink_url, article)
0
       end
0
 

Comments

    No one has commented yet.