Comments (4)
When you call spam?
, Akismet responds with one of true
, false
, or an error message. You can check the literal response with akismet_response
. Calling spam!
modifies the local value of spam?
but it doesn't change what Akismet originally said -- that's why you still see false
. (akismet_response
is really meant as a way to investigate error messages, it's not the primary way to see if a comment is spam.)
When you find the comment again and call spam?
, you're making another call to Akismet. Akismet still thinks your comment is fine. (Even though you called spam!
, which does send that info back to Akismet, a single correction probably isn't enough to change Akismet's opinion.) If you want the value of spam?
to remain consistent, you'll probably have to add a field to your model to store it. You could store the original value of spam?
in there, and if you decide to change it with spam!
or ham!
, just update that field as well. That way you won't be asking Akismet every time, and if you disagree with Akismet you can preserve your own value.
Does that make sense?
from rakismet.
When you call
spam?
, Akismet responds with one oftrue
,false
, or an error message. You can check the literal >response withakismet_response
. Callingspam!
modifies the local value ofspam?
but it doesn't change what >Akismet originally said -- that's why you still seefalse
. (akismet_response
is really meant as a way to investigate >error messages, it's not the primary way to see if a comment is spam.)When you find the comment again and call
spam?
, you're making another call to Akismet. Akismet still thinks your >comment is fine. (Even though you calledspam!
, which does send that info back to Akismet, a single correction >probably isn't enough to change Akismet's opinion.)
OK, thanks for your detailed answer ! Now I understand the issue.
If you want the value of
spam?
to remain consistent, you'll probably have to add a field to your model to store it.
You could store the original value ofspam?
in there,
When should I store it, do you mean the FIRST TIME the comment is analyzed by akismet ?
and if you decide to change it with
spam!
orham!
, just update that field as well. That way you won't >be asking Akismet every time, and if you disagree with Akismet you can preserve your own value.
Ok, suppose I have an admin page with a list of 3 comment records and akismet parsed them as false
Then I realized that 2 of them are actually spam.
Using akismet (spam!
) I set both as spam and update a new model field (lets say isSpam) to true
.
Then the spammer that created the previous 2 comments submit another comment.
Akismet still think it is not an spam, even using the same user_ip, user_agen, referrer or whatever info equal to the previous 2 comments.
How should I use isSpam or akismet to mark this new comment as spam ?
I simple didn't understand the workflow you recommend my, sorry. Could you explain it again ?
Thanks !
from rakismet.
I would always ask Akismet for spam?
first, to get an initial value. I'd also set your custom isSpam
field to the value spam?
at the same time, so both fields are equal.
If you need to mark a comment as spam, just update isSpam
to true
.
Then, when you're outputting comments, always call isSpam
instead of spam?
, since spam?
will fetch a response from Akismet but you want the locally stored value.
Does that make sense?
from rakismet.
Yes, thanks !
from rakismet.
Related Issues (20)
- ArgumentError: invalid byte sequence in UTF-8 in ruby-1.9.2-p136 HOT 1
- rakismet_attrs not propogated to subclasses HOT 2
- Define raskimet attrs with accepts_nested_attributes_for HOT 4
- which is the best way to update my Table and define raskimet attributes ? HOT 6
- SocketError (getaddrinfo: nodename nor servname provided, or not known): HOT 1
- Turn off rakismet in tests HOT 1
- permalink never set (or used) HOT 7
- Rakismet don't work HOT 1
- Rails 4 not compatible?
- user_role is not working HOT 5
- List required fields? HOT 1
- Building headers with Rails.version causes NoMethodError
- How does the model have access to the request environment? HOT 7
- Problem when validating extra attributes HOT 1
- permalink parameter is sent as comment_permalink HOT 2
- Unicode URL support. HOT 2
- Rakismet in test and development environments? HOT 5
- v1.0.1 doesn't work with Rails 2.3.10 (possibly anything pre Rails 3?) HOT 2
- rakismet-1.0.0/lib/rakismet/railtie.rb:12:in `key': wrong number of arguments(0 for 1) (ArgumentError) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rakismet.