feat: +fl.ru
This commit is contained in:
21
main.py
21
main.py
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user