joshfrench / rakismet

Easy Akismet and TypePad AntiSpam integration for Rails
MIT License
355 stars 46 forks source link

permalink never set (or used) #29

Closed ehoch closed 10 years ago

ehoch commented 11 years ago

I noticed the readme makes reference to sending the permalink:

permalink     : the permanent URL for the entry the comment belongs to

But then it's never used in the actual code.

ehoch commented 11 years ago

@joshfrench Just pinging you on this. Is the app still maintained? Should I do a pull request fixing this?

joshfrench commented 11 years ago

Sorry for the delay! Akismet does collect that parameter, and omitting from Rakismet was an oversight. I'd love a pull request if you feel like implementing it. Thanks for catching that!

ehoch commented 11 years ago

Yeah it seems as simple as adding it to a few arrays of yours. I'll gladly submit a PR.

I've been having MASSIVE spam issues on my sites and want to see any additional data points I can give akismet. Are there any other parameters they take? Where did you find the specs when creating this?

All I can find is parsing through library code, where I saw they take the PHP _SERVER array. Curious if they would take some kind of RoR equivalent or any other data points we're missing..

joshfrench commented 11 years ago

The official API docs are here: http://akismet.com/development/api/

It's not clear if they recommend sending $_SERVER in addition to the listed params, or if they're just suggesting you use that array to populate the data you send back to them. None of their code samples send $_SERVER whole, so I'd always assumed it was the latter.

They've been pretty helpful in the past though, it would be a good question for them.

ehoch commented 11 years ago

@joshfrench Looks like they will accept any HTTP header as a parameter to help them parse. Exact wording from them:

Some of it would certainly help.  The PHP $_SERVER array contains CGI variables and HTTP headers roughly according to the CGI spec: http://www.faqs.org/rfcs/rfc3875.html

In particular it's the HTTP_ headers such as HTTP_ACCEPT, HTTP_VIA, HTTP_FORWARDED_FOR and so on that are especially useful.  If you can pass them named in the CGI fashion (uppercase with underscores) then we'll be able to use them immediately.
ehoch commented 11 years ago

@joshfrench I've submitted two PRs to you. One with the permalink fix. The other will send HTTP_ headers (all they care about from $_SERVER -- if middleware is enabled). All of this is from communication with them.

Let me know if you can merge next week and I can work with Akismet to make sure they're using these data points from us.

ehoch commented 10 years ago

Closed via 17c9e1c761ea1c45315a8dcda38c7647e7fde1a3