Skip to content

How to implement a bot match with only IP ranges and no user agent (Copyscape) #19

Answered by alaz
oboxodo asked this question in Q&A
Discussion options

You must be logged in to vote

You do not have to have a rule. The rule definitions are used to find a proper bot instance, but you can call checks explicitly:

if request_from_copyscape?
  Legitbot::Copyscape.fake?(ip)
  Legitbot::Copyscape.valid?(ip)
end

Otherwise, you could simply white list these IP addresses and not use Legitbot for these. There is no much sense in validating a bot that does not present itself and has only limited set of source IP addresses. The whole idea of "validating" is about requests that pretend to be from a bot, but need to be validated.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by alaz
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #19 on December 10, 2020 12:14.