Socket
Book a DemoInstallSign in
Socket

semantic_antispam

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

semantic_antispam

0.1.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

Semantic Antispam

Simple semantic antispam solution for ActiveRecord-based applications.

Define questions and answers in a YAML file and validate your models with a single line of code. No more captchas or other stupid tricks.

Installation

Add the dependency to your Gemfile

gem 'semantic_antispam'

Create a questions file at config/antispam.yml with the following format:

- Color of the sea?: blue
- Color of the sky?: blue
- Capital of France?: paris

If you are not using Rails or want to save this file in a different location:

# config/application.rb if this is a Rails app

Semantic::Antispam.config_file = Rails.root + '/antispam.yml'

You can also customize the validation error message by adding a key to your translations file:

semantic_antispam:
  error_msg: "I'm not sure you're human. I'll give you another chance, please answer the question again."

Usage

If you want to check the humanness of your commenters, just modify your Comment model:

class Comment < ActiveRecord::Base
  semantic_antispam
end

And add this code in your comment form:

<%= f.hidden_field :antispam_hash %>
<%= f.label :antispam_answer, f.object.antispam_question %>
<%= f.text_field :antispam_answer %>

Contributing

If you want to improve semantic_antispam

  • Fork the repo
  • Create a topic branch git checkout -b my_feature
  • Push it! git push origin my_feature
  • Open a pull request

Issues

http://github.com/jrom/semantic_antispam/issues

FAQs

Package last updated on 23 Dec 2010

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.