feat(search): hackernews + stackexchange + pubmed adapters#63
Merged
Conversation
Three more keyless research backends: - hackernews (alias hn): Algolia HN search; Ask/Show HN fall back to the thread URL; snippet shows points/comments. - stackexchange (aliases stackoverflow/so): Q&A search, default site stackoverflow (DEEPDIVE_STACKEXCHANGE_SITE to switch); entity-decoded titles; snippet shows score/answers/accepted. - pubmed: NCBI E-utilities esearch->esummary; abstract-page sources; snippet shows authors/journal/date. Each reuses searchTimeoutSignal and keeps its transform in an exported pure mapper. Registered in resolveSearchAdapter; doctor probes generically. 21 new tests (568 total green); all three verified against live APIs. deepdive now ships 12 search adapters.
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.
Summary
Three more keyless research backends, bringing deepdive to 12 search adapters.
--search=hackernews(hn)--search=stackexchange(stackoverflow,so)stackoverflow;DEEPDIVE_STACKEXCHANGE_SITEswitches (serverfault, …). Entity-decoded titles; snippet shows score/answers/accepted.--search=pubmedDesign
docs/search-adapter.md:searchTimeoutSignalfor the hardened timeout, response→SearchResult[]transform in an exported pure mapper (mapHNHits/mapStackExchangeItems/mapPubMedSummary), throws on non-2xx, absolute URLs.error_message(e.g. throttling) as a thrown error.resolveSearchAdapter;deepdive doctorprobes them generically.Tests
21 new tests (pure mappers, alias resolution, stubbed-
fetchrequest shapes, error paths). 568/568 green,tsc --strictclean. Verified against the live HN / Stack Overflow / PubMed APIs — real URLs, titles, scores, author lists, and abstract links all parse.