Module: Spamster
- Defined in:
- lib/spamster.rb,
lib/spamster/model.rb,
lib/spamster/version.rb,
lib/spamster/model/proxy.rb,
lib/spamster/rack/middleware.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"1.0.1"
Class Attribute Summary collapse
-
.api_host ⇒ Object
Returns the value of attribute api_host.
-
.blog ⇒ Object
Returns the value of attribute blog.
-
.debug_output ⇒ Object
Returns the value of attribute debug_output.
-
.key ⇒ Object
Returns the value of attribute key.
-
.request_params ⇒ Object
Returns the value of attribute request_params.
Class Method Summary collapse
- .ham!(params) ⇒ Object
- .key_valid? ⇒ Boolean
- .spam!(params) ⇒ Object
- .spam?(params) ⇒ Boolean
- .use_akismet(key, blog) ⇒ Object
- .use_typepad(key, blog) ⇒ Object
Class Attribute Details
.api_host ⇒ Object
Returns the value of attribute api_host.
11 12 13 |
# File 'lib/spamster.rb', line 11 def api_host @api_host end |
.blog ⇒ Object
Returns the value of attribute blog.
11 12 13 |
# File 'lib/spamster.rb', line 11 def blog @blog end |
.debug_output ⇒ Object
Returns the value of attribute debug_output.
11 12 13 |
# File 'lib/spamster.rb', line 11 def debug_output @debug_output end |
.key ⇒ Object
Returns the value of attribute key.
11 12 13 |
# File 'lib/spamster.rb', line 11 def key @key end |
.request_params ⇒ Object
Returns the value of attribute request_params.
11 12 13 |
# File 'lib/spamster.rb', line 11 def request_params @request_params end |
Class Method Details
.ham!(params) ⇒ Object
43 44 45 |
# File 'lib/spamster.rb', line 43 def ham!(params) perform_spam_post("submit-ham", params) end |
.key_valid? ⇒ Boolean
26 27 28 29 30 |
# File 'lib/spamster.rb', line 26 def key_valid? params = {:blog => blog, :key => key} response = perform_post("http://#{api_host}/1.1/verify-key", params) response.body == 'valid' end |
.spam!(params) ⇒ Object
38 39 40 |
# File 'lib/spamster.rb', line 38 def spam!(params) perform_spam_post("submit-spam", params) end |
.spam?(params) ⇒ Boolean
33 34 35 |
# File 'lib/spamster.rb', line 33 def spam?(params) perform_spam_post("comment-check", params) == 'true' end |
.use_akismet(key, blog) ⇒ Object
13 14 15 16 17 |
# File 'lib/spamster.rb', line 13 def (key, blog) self.api_host = "rest.akismet.com" self.blog = blog self.key = key end |
.use_typepad(key, blog) ⇒ Object
19 20 21 22 23 |
# File 'lib/spamster.rb', line 19 def use_typepad(key, blog) self.api_host = "api.antispam.typepad.com" self.blog = blog self.key = key end |