feat: +fl.ru

This commit is contained in:
2026-07-14 15:04:31 +07:00
parent 8b0e1ffffa
commit a0f1f1ade8
6 changed files with 97 additions and 10 deletions

21
main.py
View File

@@ -10,7 +10,7 @@ from apscheduler.schedulers.asyncio import AsyncIOScheduler
from app.config import load_settings
from app.service import OfferProcessingService
from app.sources import KworkSource
from app.sources import FlSource, KworkSource
from app.state import SentOffersStore
from app.telegram import TelegramPublisher
@@ -63,13 +63,22 @@ async def main() -> None:
publisher = TelegramPublisher(bot=bot, channel_id=settings.telegram_channel_id)
store = SentOffersStore(settings.state_file)
service = OfferProcessingService(
sources=[
KworkSource(
category_ids=settings.kwork_category_ids,
sources = [
KworkSource(
category_ids=settings.kwork_category_ids,
timeout_seconds=settings.requests_timeout_seconds,
)
]
if settings.fl_rss_url:
sources.append(
FlSource(
rss_url=settings.fl_rss_url,
timeout_seconds=settings.requests_timeout_seconds,
)
],
)
service = OfferProcessingService(
sources=sources,
publisher=publisher,
sent_offers_store=store,
include_keywords=settings.keywords_include,