Documentation
¶
Overview ¶
Package classifier labels each fetch result with how the site treated it.
Index ¶
Constants ¶
const ( Error = "error" Challenged = "challenged" RateLimited = "rate-limited" Blocked = "blocked" Cloaked = "cloaked" RobotsDisallow = "robots-disallowed" Allowed = "allowed" )
Classifications, from most to least severe.
const DefaultCloakThreshold = 0.5
DefaultCloakThreshold is the visible-text similarity below which an allowed response is reported as cloaked.
Variables ¶
This section is empty.
Functions ¶
func BaselineIndex ¶
func BaselineIndex(results []types.FetchResult) int
BaselineIndex returns the index of the browser baseline result, or -1. Profiles marked browser win; otherwise a profile named like Chrome is used.
func Classify ¶
func Classify(r types.FetchResult) string
Classify returns the classification for a single result.
func ClassifyAll ¶
func ClassifyAll(results []types.FetchResult, threshold float64)
ClassifyAll sets Classification on every result in place. When a browser baseline was fetched successfully, every other allowed result is compared with it and marked cloaked if its visible text similarity is below threshold. A threshold <= 0 disables cloaking detection.
func CompareProducts ¶ added in v0.3.0
func CompareProducts(results []types.FetchResult)
CompareProducts flags agents that were shown different product data than the browser baseline: missing structured data, or a different price or availability. It only looks at allowed results.
Types ¶
This section is empty.