Skip to content

Commit

Permalink
patch: 修正の確認パッチ
Browse files Browse the repository at this point in the history
  • Loading branch information
yamadashy committed Aug 24, 2024
1 parent d6b8db8 commit 8a17caa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 31 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
# NOTE: UTCなので9時間引く
# 毎週土曜日の午前9時に実行
Expand Down
35 changes: 5 additions & 30 deletions src/resources/feed-info-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,12 @@ const createFeedInfoList = (feedInfoTuples: FeedInfoTuple[]) => {
};

export const fetchFeedInfoList = async (): Promise<FeedInfo[]> => {
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<string>();
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]]));
];
};

/**
Expand Down

0 comments on commit 8a17caa

Please sign in to comment.