Repository navigation
Add Ahrefs Domain Rating to the ad network directory - #131
Merged
Merged
Conversation
A new OVH job, domain-rating, collects DR for ad network publisher sites from Ahrefs' free endpoint: managed sites first, then other listed sites, then the rest, then the oldest checks after 30 days. It runs hourly (500 domains, 30-minute budget), at least 3 seconds between requests. It shares one crash-safe pacing and cooldown state with the launch-directory metrics job, which uses the same key, so a Retry-After received by either stops both. DR-only writes do not move the frontend revision; the daily snapshot publishes new values. Pages: a Domain rating block on each network page (median, average, coverage, bands, comparison with the big networks, hidden below 20 rated sites or 25% coverage), a DR column, sorts and filter in the sites lists, a checker row, and average DR on the stats page. Every place that shows or returns DR, including the public JSON APIs and the private MCP and REST, carries the linked "Domain Rating by Ahrefs" credit, as the Ahrefs license requires. The migration adds nullable columns and a NOT VALID range check, then validates it in a second transaction to avoid a long table lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RaviTejaKNTS
had a problem deploying
to
production
November 14, 2026 10:45 — with
GitHub Actions
Failure
RaviTejaKNTS
temporarily deployed
to
production
November 14, 2026 11:10 — with
GitHub Actions
Inactive
This branch was previously deployed
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
domain-rating(scripts/ad-networks/domain-rating.mjs) fetches Ahrefs Domain Rating for ad network publisher sites from the free endpoint.5 7-23 * * *, 500 domains, 30-minute budget, at least 3 seconds between requests.scripts/stack127/ahrefs-dr.mjs, used by this job and the launch-directory metrics job./srv/stack127-data/state/ahrefs.sqlite, so aRetry-Afterreceived by either job stops both.domain_ratinganddomain_rating_checked_onin the SQLite store and PostgreSQL, synced in 500-row batches. DR-only writes do not move the frontend revision; the daily snapshot publishes new values.main./api/ad-networks/sitesand/api/ad-networks/siteresponses, carries the linked "Domain Rating by Ahrefs" credit required by the Ahrefs license.NOT VALIDrange check, validated in a second transaction to avoid a long lock on the 125,000-row table. Idempotent, with type guards.Review
Three review rounds by a separate reviewer. Fixed:
The final round found no issues. Rebased on
mainwith the brand kit changes; conflicts inlib/data-apiand the MCP guide were resolved by keeping both.Checks
npm run quality: TypeScript and 133 tests.npm run test:data-api: 19 tests.Rollout after merge
AHREFS_API_KEYto Infisicalstack127 /vps/ad-networks./srv/stack127on OVH with both Ahrefs jobs stopped, since the lock path changed.🤖 Generated with Claude Code