Net::G...Lookup(3pm)
β¨ NAME β¨
okay bestie, gather round π this is Net::Google::SafeBrowsing2::Lookup β a Perl extension (a 3pm manual, so it lives in the User Contributed Perl Documentation zone) for the Google Safe Browsing v2 Lookup API. yes, that Google. the one that tells you a site is shady before you click it. iconic behavior honestly π‘οΈβ¨
πΈ SYNOPSIS πΈ
here's the vibe, copy-paste ready:
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";
}
likeβ¦ you literally make an object, hand it a URL, and it tells you if that URL is giving malware π¦ π no cap.
π¦ DESCRIPTION π¦
Net::Google::SafeBrowsing2::Lookup implements the Google Safe Browsing v2 Lookup API. the official API docs are chillin' at <http://code.google.com/apis/safebrowsing/lookup_guide.html> π
bestie, real talk: if you need to check more than 10,000 URLs a day, this module is NOT the one. you need to use Net::Google::SafeBrowsing2 instead. periodt.
the source code is available on github at <https://github.com/juliensobrier/Net-Google-SafeBrowsing2> π go star it or whatever, it's the respectful thing to do.
π CONSTRUCTOR π
new()
creates a Net::Google::SafeBrowsing2::Lookup object. your main character moment starts here:
my $gsb = Net::Google::SafeBrowsing2::Lookup->new(
key => "my key",
debug => 0,
);
Arguments
keyβ Required. your Google Safe Browsing API key π no key, no vibes.debugβ Optional. set it to1to turn on debugging. it's0(disabled) by default.- > lowkey a warning: the debug output maybe quite large and can slow down significantly the update and lookup functions π so maybe don't leave it on forever.
errorsβ Optional. set it to1to show errors toSTDOUT.0(disabled by default).versionβ Optional. Google Safe Browsing version.3.0by default πdelayβ Optional. delay, in seconds, between 2 requests to the Google server. see the"lookup"function for more details.0(no delay) by default. pls be nice to the server π«Ά
π PUBLIC FUNCTIONS π
lookup()
looks up a list of URLs against the Google Safe Browsing v2 lists. the moment of truth:
my %match = $gsb->lookup(url => 'http://www.gumblar.cn');
returns a hash of "url" => "Google match". the possible values for "Google match" are:
"ok"β no match, we love a clean URL β¨"malware"π¦"phishing"π£"malware,phishing"β match both lists, double yikes π"error"π
Arguments
urlβ Optional. a single URL to lookup.urlsβ Optional. list of URLs to lookup.- > okay so the Lookup API allows only 10,000 URL checks a day. if you need more, use the
Net::Google::SafeBrowsing2library, fr fr. - each request must contain 500 URLs at most. the
lookup()method will split the list of URLs in blocks of 500 URLs if needed β it's got you, bestie π«Ά
- > okay so the Lookup API allows only 10,000 URL checks a day. if you need more, use the
delayβ Optional. if more than 500 URLs are checked, wait"delay"seconds between consecutive requests to avoid rate limiting by Google. respect the rate limit or get humbled, iykyk.
π CHANGELOG π
0.2Documentation update.
(short and sweet, we love a glow-up β¨)
π SEE ALSO π
see Net::Google::SafeBrowsing2 for the implementation of Google Safe Browsing v2 API. that's the big sibling, go say hi π«Ά
π AUTHOR π
Julien Sobrier, <jsobrier@zscaler.com> or <julien@sobrier.net> β the icon, the legend, the moment π
π COPYRIGHT AND LICENSE π
Copyright (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. slay, legally speaking π
and that's the whole page, bestie π¦ this was Net::G...Lookup(3pm) from perl v5.32.0, dated 2021-01-07 β mwah, go be safe on the internet πβ¨
π¦ where this page comes from
- ubuntu jammy: libnet-google-safebrowsing2-perl 1.07-6.1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms