jonahb / akismet Goto Github PK
View Code? Open in Web Editor NEWA Ruby client for the Akismet API
License: MIT License
A Ruby client for the Akismet API
License: MIT License
Akismet has a test mode; we should be able to use it.
The reason for this is mentioned on https://github.com/joshfrench/rakismet:
Rakismet can be configued to tell Akismet that it should operate in test mode - so Akismet will not change its behavior based on any test API calls, meaning they will have no training effect. That means your tests can be somewhat repeatable in the sense that one test won't influence subsequent calls.
This sounds like a reasonable behavior too:
NOTE: When running in Rails, Rakismet will run in test mode when your Rails environment is test or development, unless explictly configured otherwise. Outside of Rails Rakismet defaults to test mode turned off.
It would be great if you could add a tag for 1.0.0 to this repository
I've used this gem for 100K+ spam checks, 10K+ were marked as spam, and exactly 0 were marked as blatant. Is there a problem with Akismet, or this gem, or maybe there's a problem with my code (is there specific content I can send to trigger the blatant flag?).
I noticed that data is being sent over http, not https:
Line 97 in b03f7fd
The SDK correctly formats datetimes that are DateTime
but not Time
Lines 337 to 338 in 75cb340
This should probably be updated to account for both since they both have the iso8601
method.
Lines 59 to 63 in b03f7fd
The internet made a mistake on the spelling of "referrer" so we need to make sure we always use "referer" instead.
client.rb:376 needs to be updated to referer: :referer
Akismet::Error expected but was
<URI::InvalidURIError(<the scheme http does not accept registry part: invalid_api_key.rest.akismet.com:80 (or bad hostname?)>)>
diff:
? A kismet ::Error
Failure:
test_submit_ham_with_invalid_api_key_raises(ClientTest)
/var/tmp/portage/dev-ruby/akismet-1.0.1/work/ruby20/akismet-1.0.1/test/client_test.rb:54:in `test_submit_ham_with_invalid_api_key_raises'
51: end
52:
53: def test_submit_ham_with_invalid_api_key_raises
=> 54: error = assert_raise( Akismet::Error ) do
55: @invalid_client.submit_ham 'ip', 'ua'
56: end
57: assert_equal Akismet::Error::INVALID_API_KEY, error.code
Akismet::Error expected but was
<URI::InvalidURIError(<the scheme http does not accept registry part: invalid_api_key.rest.akismet.com:80 (or bad hostname?)>)>
diff:
? A kismet ::Error
Failure:
test_submit_spam_with_invalid_api_key_raises(ClientTest)
/var/tmp/portage/dev-ruby/akismet-1.0.1/work/ruby20/akismet-1.0.1/test/client_test.rb:65:in `test_submit_spam_with_invalid_api_key_raises'
62: end
63:
64: def test_submit_spam_with_invalid_api_key_raises
=> 65: error = assert_raise( Akismet::Error ) do
66: @invalid_client.submit_spam 'ip', 'ua'
67: end
68: assert_equal Akismet::Error::INVALID_API_KEY, error.code
Akismet::Error expected but was
<URI::InvalidURIError(<the scheme http does not accept registry part: invalid_api_key.rest.akismet.com:80 (or bad hostname?)>)>
diff:
? A kismet ::Error
..
Finished in 2.922023833 seconds.
13 tests, 22 assertions, 3 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
76.9231% passed
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.