|
NAMENet::Google::SafeBrowsing2::Lookup - Perl extension for the Google Safe Browsing v2 Lookup API. SYNOPSIS use Net::Google::SafeBrowsing2::Lookup;
my $gsb = Net::Google::SafeBrowsing2::Lookup->new(
key => "my key",
);
my %match = $gsb->lookup(url => 'http://www.gumblar.cn/');
if ($match{'http://www.gumblar.cn/'} eq 'malware') {
print "http://www.gumblar.cn/ is flagged as a dangerous site\n";
}
my %matches = $gsb->lookup(urls => ['http://www.gumblar.cn/', 'http://flahupdate.co.cc']);
foreach my $url (keys %matches) {
print $url, " is ", $matches{$url}, "\n";
}
DESCRIPTIONNet::Google::SafeBrowsing2::Lookup implements the Google Safe Browsing v2 Lookup API. See the API documentation at <http://code.google.com/apis/safebrowsing/lookup_guide.html>. If you need to check more than 10,000 URLs a day, you need to use Net::Google::SafeBrowsing2. The source code is available on github at <https://github.com/juliensobrier/Net-Google-SafeBrowsing2>. CONSTRUCTORnew()Create a Net::Google::SafeBrowsing2::Lookup object my $gsb = Net::Google::SafeBrowsing2::Lookup->new(
key => "my key",
debug => 0,
);
Arguments
PUBLIC FUNCTIONSlookup()Lookup a list URLs against the Google Safe Browsing v2 lists. my %match = $gsb->lookup(url => 'http://www.gumblar.cn'); Returns a hash "url" => "Google match". The possible list of values for "Google match" are: "ok" (no match), "malware", "phishing", "malware,phishing" (match both lists) and "error". Arguments
CHANGELOG
SEE ALSOSee Net::Google::SafeBrowsing2 for the implementation of Google Safe Browsing v2 API. AUTHORJulien Sobrier, <jsobrier@zscaler.com> or <julien@sobrier.net> COPYRIGHT AND LICENSECopyright (C) 2012 by Julien Sobrier This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
|