From 03bc3271e0719e33c9517180bb2d39b0d73b7b90 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Sun, 13 Apr 2025 18:00:11 -0700 Subject: move to generic news_feed module --- scrape.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 scrape.py (limited to 'scrape.py') diff --git a/scrape.py b/scrape.py new file mode 100644 index 0000000..8d1f467 --- /dev/null +++ b/scrape.py @@ -0,0 +1,26 @@ +""" +Generates news JSON files +""" +import news_feed as feed +import constants +import json +import os + + +OUTPUT_DIR = "news" + +if __name__ == "__main__": + if not os.path.exists(OUTPUT_DIR): + os.makedirs(OUTPUT_DIR) + + iidx_news_data = feed.get_news(constants.IIDX_PINKY_CRUSH_NEWS_SITE) + with open(OUTPUT_DIR+'/iidx_news.json', 'w') as json_file: + json.dump(iidx_news_data, json_file) + + sdvx_news_data = feed.get_news(constants.SOUND_VOLTEX_EXCEED_GEAR_NEWS_SITE) + with open(OUTPUT_DIR+'/sdvx_news.json', 'w') as json_file: + json.dump(sdvx_news_data, json_file) + + chunithm_jp_news_data = feed.get_news(constants.CHUNITHM_NEWS_SITE, constants.CHUNITHM_VERSION.VERSE) + with open(OUTPUT_DIR+'/chunithm_jp_news.json', 'w') as json_file: + json.dump(chunithm_jp_news_data, json_file) -- cgit v1.2.3