Downloader ========== The ``news/downloader.py`` module ships the two manager classes that the news-fetching Celery tasks delegate to. Both share a :class:`~richy.news.downloader.BaseManager` that supplies a URL blacklist check (against ``settings.NEWS_BLACKLIST``) and a Yahoo-video URL detector. * :class:`~richy.news.downloader.ShareIndexEtfManager` -- RSS-based fetcher that reads Yahoo Finance's RSS feed for a share / ETF / index symbol, follows the redirect to each article, parses metadata via ``metadata_parser`` (falling back to the RSS-embedded data on failure), and saves a :class:`~richy.news.models.News` row per article. * :class:`~richy.news.downloader.CoinManager` -- Karpet-based fetcher; pulls a coin's recent news feed via ``Karpet.fetch_news`` and saves one :class:`~richy.news.models.News` row per item. Both managers skip URLs already present in the database and URLs on the blacklist; both ``fetch()`` methods return the count of new news rows created. BaseManager ----------- .. autoclass:: richy.news.downloader.BaseManager :show-inheritance: .. automethod:: richy.news.downloader.BaseManager.is_on_blacklist .. automethod:: richy.news.downloader.BaseManager.is_video ShareIndexEtfManager -------------------- .. autoclass:: richy.news.downloader.ShareIndexEtfManager :show-inheritance: .. automethod:: richy.news.downloader.ShareIndexEtfManager.fetch .. automethod:: richy.news.downloader.ShareIndexEtfManager.parse_target .. automethod:: richy.news.downloader.ShareIndexEtfManager.create_news CoinManager ----------- .. autoclass:: richy.news.downloader.CoinManager :show-inheritance: .. automethod:: richy.news.downloader.CoinManager.fetch