This library can use many back-ends for storage. In addition to Sqlite, MySQL and Postgres (added by a contributor), you can now use Redis, a fast key-value store, as a back-end for Google Safe Browsing with Net::Google::SafeBrowsing2::Redis (source available on github). This storage speeds up updates by a factor of 10 over the SQL back-ends.
Upgrade Net::Google::SafeBrowsing2
Numerous fixes and improvements went into the Net::Google::SafeBrowsing2 in the past few weeks, so make sure you are running the latest version.
I have also introduced a new import/export feature that makes it easy to switch from one back-end to another. You can easily switch from the MySQL back-end to the Redis back-end, for example:
my $mysql = Net::Google::SafeBrowsing2::MySQL->new(...);
$mysql->export(list => MALWARE, file => 'malware.dat');
$mysql->export(list => PHISHING, file => 'phishing.dat');
my $redis = Net::Google::SafeBrowsing2::Redis->new(...);
my $gsb = Net::Google::SafeBrowsing2->new(key => ..., storage => $redis);
$gsb->import_chunks(list => MALWARE, file => 'malware.dat');
$gsb->import_chunks(list => PHISHING, file => 'phishing.dat');Despite the popularity of Google Safe Browsing (used by Firefox, Google Chrome and Safari), there are still very few implementations available and even fewer complete implementations. Since I published a list of Google Safe Browsing libraries available back in December 2011, I'm aware of just one new implementation for Scala/Java. Popular languages like Ruby don't have such libraries yet.
No comments:
Post a Comment