From 8a17caa73b5ffd73eff0ffe979491b8013aa0057 Mon Sep 17 00:00:00 2001 From: Kazuki Yamada Date: Sat, 24 Aug 2024 15:45:45 +0900 Subject: [PATCH] =?UTF-8?q?patch:=20=E4=BF=AE=E6=AD=A3=E3=81=AE=E7=A2=BA?= =?UTF-8?q?=E8=AA=8D=E3=83=91=E3=83=83=E3=83=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 1 - src/resources/feed-info-list.ts | 35 +++++---------------------------- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6739f11862c3..e5ec20533be1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,6 @@ on: push: branches: [ main ] pull_request: - branches: [ main ] schedule: # NOTE: UTCなので9時間引く # 毎週土曜日の午前9時に実行 diff --git a/src/resources/feed-info-list.ts b/src/resources/feed-info-list.ts index 0b332ae93121..c3691d78c20e 100644 --- a/src/resources/feed-info-list.ts +++ b/src/resources/feed-info-list.ts @@ -21,37 +21,12 @@ const createFeedInfoList = (feedInfoTuples: FeedInfoTuple[]) => { }; export const fetchFeedInfoList = async (): Promise => { - interface FeedItem { - url: string; - feeds: ValidUrl[]; - } - // RSSの一覧を取得 - const response = await fetch('https://jser.info/watch-list/data/opml-list.json'); - const feedInfoList: FeedItem[] = await response.json(); - // 特定のドメインは除外する - const ExcludedDomains = [ - // beta的なリリースが埋まりやすいため - 'github.com', - // https://github.com/jser/watch-list-rss/issues/1 - 'www.aha.io', - ]; - // フィードの重複を取り除く - const tmpUsedDomainSet = new Set(); - const feedInfoListWithoutDomains = feedInfoList.filter((feedItem) => { - const feedUrl = feedItem.feeds[0]; - if (!feedUrl) { - return false; + return [ + { + label: 'https://www.aha.io/blog/feed.xml', + url: 'https://www.aha.io/blog/feed.xml', } - const feedHostname = new URL(feedItem.feeds[0]).hostname; - if (tmpUsedDomainSet.has(feedHostname) || tmpUsedDomainSet.has(feedUrl)) { - return false; - } - tmpUsedDomainSet.add(feedHostname); - tmpUsedDomainSet.add(feedUrl); - // remove duplicate domain - return !ExcludedDomains.includes(feedHostname); - }); - return createFeedInfoList(feedInfoListWithoutDomains.map((feedItem) => [feedItem.url, feedItem.feeds[0]])); + ]; }; /**