Skip to content

fix(duckduckgo): mark y.js ad links as ads - #60

Open
hasandenizuk wants to merge 1 commit into
karust:mainfrom
hasandenizuk:fix/59-ddg-ad-links
Open

hasandenizuk wants to merge 1 commit into
karust:mainfrom
hasandenizuk:fix/59-ddg-ad-links

Conversation

@hasandenizuk

Copy link
Copy Markdown

Summary

  • Treat a result whose link is DuckDuckGo's ad click tracker (duckduckgo.com/y.js?..., absolute or relative) as an ad, in both ParseHTML and the browser search path.
  • Add isDDGAdURL with a table test, and a parser test with an ad card that has no ad badge.

Why

Testing

  • go test ./... (all packages pass; run without -race)
  • go vet ./... and golangci-lint v1.64.8 with .golangci.yml
  • make test-integration (not run: needs a browser and live DuckDuckGo; the browser path change is the same one-line check)

Checklist

  • I linked the related issue or explained why there is none.
  • I updated docs or examples for changed user-facing behavior. (no docs change needed)
  • I kept unit tests deterministic and free of browser/network dependencies.
  • I removed secrets, proxy credentials, and private logs from examples.

Fixes #59

Some DuckDuckGo ad cards come without an ad badge, so the parser and the
live search returned them as organic results. Their link still points at
DuckDuckGo's ad click tracker (duckduckgo.com/y.js?ad_domain=...), so treat
that link as an ad marker too, in both ParseHTML and the browser path.

Fixes karust#59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Remove advertisement entry from DuckDuckGo

1 participant