-
Hi there, I'm wanting to implement a
So I'm thinking something like: module Legitbot
# https://www.copyscape.com/faqs.php#password
class Copyscape < BotMatch
ip_ranges %w[
162.13.83.46
212.100.243.112
212.100.243.113
212.100.243.114
212.100.243.115
212.100.243.116
46.4.250.49
46.4.250.50
46.4.250.51
46.4.250.52
]
end
rule Legitbot::Copyscape, %w[I don't know what to put in here] # <-- here's the problem
end Can we add a rule which would only look for the IP but not the user agent? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You do not have to have a 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. |
Beta Was this translation helpful? Give feedback.
-
Makes sense. Thanks for your reply. |
Beta Was this translation helpful? Give feedback.
You do not have to have a
rule
. Therule
definitions are used to find a proper bot instance, but you can call checks explicitly: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.