diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-06-16 19:06:45 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-06-16 19:06:45 -0700 |
| commit | 37a18a1e699567115ec038c04e3789f41b38e525 (patch) | |
| tree | b911b94d57f5e88e998ade70f842377d0d4e77b8 /news_feed.py | |
| parent | c32042f7b40484e810456fc4d678f4f9c08f43b8 (diff) | |
implement idac news scrape
Diffstat (limited to 'news_feed.py')
| -rw-r--r-- | news_feed.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/news_feed.py b/news_feed.py index 7c781db..6bd5116 100644 --- a/news_feed.py +++ b/news_feed.py @@ -30,6 +30,7 @@ import sega.chuni_intl as chuni_intl import sega.maimaidx_jp as maimaidx_jp import sega.maimaidx_intl as maimaidx_intl import sega.ongeki_jp as ongeki_jp +import sega.idac as idac import taito.music_diver as music_diver import taito.street_fighter as street_fighter import bandai_namco.taiko as taiko @@ -159,6 +160,13 @@ def get_news(news_url: str, version=None) -> list: news_posts = sorted(ongeki_jp.parse_ongeki_refresh_news_site(site_data), key=lambda x: x['timestamp'], reverse=True) news_posts = translate.add_translate_text_to_en(news_posts) + elif news_url == constants.IDAC_NEWS_SITE: + site_data = download_site_as_html(news_url) + news_posts = sorted(idac.parse_idac_news_site(site_data), key=lambda x: x['timestamp'], reverse=True) + for news in news_posts: + promo_image_url = idac.get_promo_image(download_site_as_html(news["url"])) + news["images"] = [{'image': promo_image_url, 'link': None}] + elif news_url == constants.MUSIC_DIVER_NEWS: api_data = download_site_as_html(news_url) news_posts = sorted(music_diver.parse_music_diver_news_json(api_data), key=lambda x: x['timestamp'], reverse=True) @@ -166,8 +174,6 @@ def get_news(news_url: str, version=None) -> list: elif news_url == constants.STREET_FIGHTER_NEWS_SITE: site_data = download_site_as_html(news_url) news_posts = sorted(street_fighter.parse_sf_news_site(site_data), key=lambda x: x['timestamp'], reverse=True) - print(news_posts) - exit() elif news_url == constants.TAIKO_BLOG_SITE: |
