2026-06-04 00:44:11 +03:30
|
|
|
using JobsMedical.Web.Models;
|
|
|
|
|
|
2026-06-03 08:18:19 +03:30
|
|
|
namespace JobsMedical.Web.Services.Scraping;
|
|
|
|
|
|
|
|
|
|
/// <summary>One raw post pulled from a source (a Telegram message, a Divar ad, etc.).</summary>
|
|
|
|
|
public record ScrapedItem(string Source, string RawText, string? SourceUrl = null);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2026-06-04 00:44:11 +03:30
|
|
|
/// A pluggable source the ingestion engine pulls from. Configuration (enabled, channels, tokens)
|
|
|
|
|
/// comes from the DB-backed <see cref="AppSetting"/> passed in — set in the admin panel, not env.
|
|
|
|
|
/// A disabled/unconfigured source returns an empty list.
|
2026-06-03 08:18:19 +03:30
|
|
|
/// </summary>
|
|
|
|
|
public interface IListingSource
|
|
|
|
|
{
|
|
|
|
|
string Name { get; }
|
2026-06-04 00:44:11 +03:30
|
|
|
Task<IReadOnlyList<ScrapedItem>> FetchAsync(AppSetting settings, CancellationToken ct = default);
|
2026-06-03 08:18:19 +03:30
|
|
|
}
|