We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a23862a commit 48af745Copy full SHA for 48af745
packages/lib/src/crawler/index.ts
@@ -14,17 +14,15 @@ export interface ArticleResponse {
14
export const fetchArticle = async (
15
url: string,
16
): Promise<ArticleResponse | null> => {
17
- const { host } = new URL(url);
18
-
19
- if (host === 'note.com') {
+ if (/https?:\/\/note.com\/[^/]+\/n\/[^/]+/.exec(url)) {
20
return fetchArticleFromNote(url);
21
}
22
23
- if (host === 'qiita.com') {
+ if (/https?:\/\/qiita.com\/[^/]+\/items\/[^/]+/.exec(url)) {
24
return fetchArticleFromQiita(url);
25
26
27
- if (host === 'zenn.dev') {
+ if (/https?:\/\/zenn.dev\/[^/]+\/articles\/[^/]+/.exec(url)) {
28
return fetchArticleFromZenn(url);
29
30
0 commit comments