Git Product home page Git Product logo

Comments (4)

joshfrench avatar joshfrench commented on July 17, 2024

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.

localguiding avatar localguiding commented on July 17, 2024

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.)

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 of spam? 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! 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.

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.

joshfrench avatar joshfrench commented on July 17, 2024

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.

localguiding avatar localguiding commented on July 17, 2024

Yes, thanks !

from rakismet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.