Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: 修正の確認用PR #1

Draft
wants to merge 1 commit into
base: feature/merge-yamadashy
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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