Class: Html2rss::FeedResolution::CandidateGenerator
- Inherits:
-
Object
- Object
- Html2rss::FeedResolution::CandidateGenerator
- Defined in:
- lib/html2rss/feed_resolution/candidate_generator.rb
Overview
Builds same-origin entry-resolution candidates: one feed slot plus listing seeds.
Mix is 1 feed + up to listing_cap listing URLs (nav → segment first-wins →
Syndication::CandidateCatalog::LISTING_PATHS). Feed never pads into listing slots.
Constant Summary collapse
- DEFAULT_MAX =
Max candidates returned to the probe stage.
5- NAV_SELECTORS =
Nav/header/footer anchor sources for DestinationFacts ranking.
'header a[href], nav a[href], footer a[href]'- SEGMENT_STRATEGIES =
Segment strategies tried first-wins (≥2 same-origin primary links).
%i[list cluster semantic].freeze
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Array<Html2rss::Url>
-
#initialize(entry_url:, response:, max: DEFAULT_MAX) ⇒ CandidateGenerator
constructor
A new instance of CandidateGenerator.
Constructor Details
#initialize(entry_url:, response:, max: DEFAULT_MAX) ⇒ CandidateGenerator
Returns a new instance of CandidateGenerator.
31 32 33 34 35 |
# File 'lib/html2rss/feed_resolution/candidate_generator.rb', line 31 def initialize(entry_url:, response:, max: DEFAULT_MAX) @entry_url = Html2rss::Url.from_absolute(entry_url) @response = response @max = max end |
Class Method Details
.call(entry_url:, response:, max: DEFAULT_MAX) ⇒ Array<Html2rss::Url>
23 24 25 |
# File 'lib/html2rss/feed_resolution/candidate_generator.rb', line 23 def self.call(entry_url:, response:, max: DEFAULT_MAX) new(entry_url:, response:, max:).call end |
Instance Method Details
#call ⇒ Array<Html2rss::Url>
39 40 41 |
# File 'lib/html2rss/feed_resolution/candidate_generator.rb', line 39 def call [feed_slot, *listing_urls.first(listing_cap)].compact.uniq end |