diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-04-13 18:00:11 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-04-13 18:00:11 -0700 |
| commit | 03bc3271e0719e33c9517180bb2d39b0d73b7b90 (patch) | |
| tree | ed3b0b504b50a1ae9fb65a00f6ddd7bf270db9a4 /konami.py | |
| parent | dc0794ae2c08a35c30ae8de2d44e2a21c7875252 (diff) | |
move to generic news_feed module
Diffstat (limited to 'konami.py')
| -rw-r--r-- | konami.py | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/konami.py b/konami.py deleted file mode 100644 index 438b1ed..0000000 --- a/konami.py +++ /dev/null @@ -1,33 +0,0 @@ -""" -Fetching data for Konami/Bemani games -{ - 'date': JST date of news post - 'type': Type of post if available, otherwise if not provided it will be None (aka Generic news) - 'timestamp': Unixtime of date above, - 'headline': Headline, - 'content': All text content of news, - 'images': { - 'image': URL to image, - 'link': If there's an associated href. Else None - - } -} -""" - -from email.utils import parsedate_to_datetime -from site_scraper import SiteScraper -import bemani.sdvx as sound_voltex -import bemani.iidx as iidx -import constants - -def get_news(news_url: str) -> list: - scraper = SiteScraper(headless=True) - site_data = scraper.get_page_source(news_url) - if news_url == constants.SOUND_VOLTEX_EXCEED_GEAR_NEWS_SITE: - news_posts = sorted(sound_voltex.parse_exceed_gear_news_site(site_data, constants.EAMUSEMENT_BASE_URL), key=lambda x: x['timestamp'], reverse=True) - elif news_url == constants.IIDX_PINKY_CRUSH_NEWS_SITE: - news_posts = sorted(iidx.parse_pinky_crush_news_site(site_data, constants.EAMUSEMENT_BASE_URL), key=lambda x: x['timestamp'], reverse=True) - else: - news_posts = [] - scraper.close() - return news_posts |
