feat(enrichers): make domain_to_website extractions opt-out#186
Open
rachit367 wants to merge 1 commit into
Open
feat(enrichers): make domain_to_website extractions opt-out#186rachit367 wants to merge 1 commit into
rachit367 wants to merge 1 commit into
Conversation
domain_to_website always fetched the page and extracted headers, the full page text (up to 5000 chars), and technologies on every run, which is slow/noisy when a user only wants liveness + title (reconurge#90). Adds three optional select params (extract_content, extract_technologies, extract_headers), all defaulting to "true" so existing behavior is unchanged. Setting any to "false" skips that work. Title, description, status_code and active are always captured (cheap). Also de-duplicates the near-identical HTTPS/HTTP branches in scan() into a scheme loop + a _build_website_data helper, and drops two unused imports. This follows the params_schema convention from reconurge#60. Tests (requests mocked, no network): params schema, default full extraction, each toggle off, all-heavy-off keeping core fields, and the request-failure -> inactive path. Closes reconurge#90
Collaborator
|
Hey @rachit367, thanks for your work ! For this to work we have to implement params settings in the UI. I'll work on this next week. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds optional toggles to
domain_to_websiteso users can skip the heavier extractions (page content, technologies, headers) for faster, lighter scans.Closes #90
Why
From the issue thread:
domain_to_website"extracts a lot and can be slow." Today it unconditionally fetches the page and runs full text extraction (up to 5000 chars), technology detection, and header capture on every run — even when a user only wants liveness + title. This follows the configurable-transformer convention from #60 (safe defaults, opt-in depth).Changes
get_params_schema()with threeselectparams —extract_content,extract_technologies,extract_headers— all defaulting to"true", so existing behavior is unchanged. Setting any to"false"skips that work.title,description,status_code, andactiveare always captured (they're cheap), so disabling the heavy options still gives a useful result.scan()are collapsed into afor scheme in ("https", "http")loop plus a_build_website_data()helper (so the param-gating lives in one place, not duplicated). Header selection moved to_extract_headers(). Behavior is preserved: HTTPS is tried first, HTTP is the fallback, and a failed/≥400 fetch yields an inactive Website. Also drops two unused imports.Testing
New tests (requests mocked, no network): params schema shape + safe defaults, default full extraction (regression), each toggle off independently, all-heavy-off still keeping core fields, and the request-failure → inactive path.