Repository navigation
Give promoted seed domains priority in the crawler - #499
Open
daoudclarke wants to merge 1 commit into
Open
daoudclarke wants to merge 1 commit into
daoudclarke wants to merge 1 commit into
Conversation
The crawler reads the seed domains endpoint with its API key and puts the best queued ones at the front of each batch, ahead of core and curated domains. A promoted domain with nothing queued is seeded by its root page, and promoted domains queue as deeply as curated ones. Domains scoring zero are dropped, and MWMBL_SERVER lets a crawler run against a local server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Can we prioritize this PR? We have around 8700 seed sites discovered so far, and we're accumulating more each day. |
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 changed
The crawler now uses the promoted (seed) domains from
GET /api/v2/combined-search/seed-domainsalongside curated domains, and gives them priority.mwmbl/crawl.py):_fetch_promoted_domains()calls the endpoint with the crawler'sMWMBL_API_KEY(it needs a crawl-scoped key). It keeps the server's best-first order and drops domains scoring 0, which have no new pages left. It asks at most hourly, since the list is republished daily, and waits the hour after a failure too, so a key without the crawl scope doesn't ask on every batch. A crawler with no key has no promoted domains.mwmbl/redis_url_queue.py):MWMBL_SERVERenv var (defaulthttps://api.mwmbl.org) so the crawler can run against a local server.Why
Seed domains are scored by how likely a crawl is to add new pages that answer searches, so volunteer crawlers should spend their budget there first.
Verification
test/test_promoted_domains.py(ordering, seeding, blacklist, queue depth, fetching).make checkandmake testpass (1160 passed).mwmbl-crawl --oncethree times against a local dev server with a crawl-scoped key and three seed domains (danluu.com5,jvns.ca3,example.org0), using a spare Redis DB and submission off:example.orgdropped) and seededhttps://jvns.ca/.jvns.caled the batch, andhttps://danluu.com/was seeded.danluu.com,jvns.ca, then the core domains. The seed fell back to the HN list.One known cost: a promoted domain whose queue runs out can have its root page re-seeded until the next daily republish lowers its score. That is at most one URL per batch.
🤖 Generated with Claude Code