Net::Google::SafeBrowsing2 question?

51 views
Skip to first unread message

cosaturn

unread,
Jan 6, 2012, 11:31:29 PM1/6/12
to Google Safe Browsing API
Hello Everyone,

I recently migrated to V2 using Net::Google::SafeBrowsing2 and I am
confused about the difference between lookup and local_lookup? Is it
correct to say that, local_lookup using the local GSB database while
lookup does a remote lookup each time?

Julien Sobrier

unread,
Jan 10, 2012, 6:15:12 PM1/10/12
to google-safe-...@googlegroups.com
Hello,
from the description of the function: "This should be used for
debugging purpose only. "

The "normal" way of using the library is to use lookup(url => [...]).
The first step is to check locally (local_lookup) for a match in the
local database (on the prefix), and a match of a full hash previously
saved. The second step is to make a remote cll to Google to get the
full hash.


Julien (author of the library)

> --
> You received this message because you are subscribed to the Google Groups "Google Safe Browsing API" group.
> To post to this group, send email to google-safe-...@googlegroups.com.
> To unsubscribe from this group, send email to google-safe-browsi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-safe-browsing-api?hl=en.
>

cosaturn

unread,
Jan 11, 2012, 10:05:27 PM1/11/12
to Google Safe Browsing API
Thank you Julien!

I should be using lookup(url => ) then. Just a clarification, so the
function lookup(url => ) is actually composed of two steps 1.)
local_lookup AND 2.) remote call to Google. Is it safe to say that
when the full hash is already available locally and is still less than
45minutes "old", the remote call is no longer executed?

By the way, great module!

Julien Sobrier

unread,
Jan 11, 2012, 11:18:44 PM1/11/12
to google-safe-...@googlegroups.com
Hello,
you are correct. I will move local_lookup to the list of private
functions to avoid confusions. It is only meant for debugging, not for
regular use.

Julien

Reply all
Reply to author
Forward
0 new messages