Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 781ab1325c
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (26 sloc) 1.057 kb

Malware

Malware is a rails plugin to take advantage of the Google Safe Browsing API

Installation

Request an API key from http://code.google.com/apis/safebrowsing/key_signup.html

Create a config file with your API key. In RAILS_ROOT/config/initializers/malware_key.rb

# API key for Google Safe Browsing API
# http://code.google.com/apis/safebrowsing/
SAFEBROWSING_API_KEY = "ABQIAAAAN_MxjBsAgBKC8N1cqNloZhT3elDgi-bgogZuFD30ho7emQ1XEw"

Install the plugin

gem install malware

Generate and run a migration to create the tables

script/generate malware_migration
rake db:migrate

Example

$ script/console 
Loading development environment (Rails 2.3.5)
>> Malware.update
=> "Updated malware info (in 73.865188s) +301657/-0 (1.47438 1.18185)\n"
>> Malware.check('http://malware.testing.google.test/testing/malware/')
=> true
>> Malware.check('http://www.jorgebernal.info/')
=> false

Copyright (c) 2009 Jorge Bernal koke@amedias.org, released under the MIT license

Jump to Line
Something went wrong with that request. Please try again.