feedscout 1.9.0 → 2.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/discover/defaults.js +1 -3
- package/dist/common/discover/utils.d.ts +2 -3
- package/dist/common/uris/feed/types.d.ts +2 -2
- package/dist/feeds/extractors.js +2 -2
- package/dist/feeds/platform/handlers/discourse.js +2 -6
- package/dist/feeds/platform/handlers/libsyn.js +1 -1
- package/package.json +23 -62
- package/dist/blogrolls/defaults.cjs +0 -57
- package/dist/blogrolls/defaults.d.cts +0 -16
- package/dist/blogrolls/extractors.cjs +0 -21
- package/dist/blogrolls/extractors.d.cts +0 -7
- package/dist/blogrolls/index.cjs +0 -25
- package/dist/blogrolls/index.d.cts +0 -7
- package/dist/blogrolls/types.d.cts +0 -6
- package/dist/blogrolls.cjs +0 -12
- package/dist/blogrolls.d.cts +0 -4
- package/dist/common/discover/defaults.cjs +0 -46
- package/dist/common/discover/defaults.d.cts +0 -6
- package/dist/common/discover/index.cjs +0 -105
- package/dist/common/discover/utils.cjs +0 -101
- package/dist/common/discover/utils.d.cts +0 -6
- package/dist/common/locales.cjs +0 -348
- package/dist/common/types.cjs +0 -10
- package/dist/common/types.d.cts +0 -90
- package/dist/common/uris/feed/index.cjs +0 -12
- package/dist/common/uris/feed/index.d.cts +0 -6
- package/dist/common/uris/feed/types.d.cts +0 -9
- package/dist/common/uris/guess/index.cjs +0 -8
- package/dist/common/uris/guess/index.d.cts +0 -7
- package/dist/common/uris/guess/types.d.cts +0 -10
- package/dist/common/uris/guess/utils.cjs +0 -42
- package/dist/common/uris/guess/utils.d.cts +0 -8
- package/dist/common/uris/headers/index.cjs +0 -26
- package/dist/common/uris/headers/index.d.cts +0 -6
- package/dist/common/uris/headers/types.d.cts +0 -9
- package/dist/common/uris/html/handlers.cjs +0 -59
- package/dist/common/uris/html/index.cjs +0 -35
- package/dist/common/uris/html/index.d.cts +0 -6
- package/dist/common/uris/html/types.d.cts +0 -13
- package/dist/common/uris/index.cjs +0 -32
- package/dist/common/uris/platform/index.cjs +0 -10
- package/dist/common/uris/platform/index.d.cts +0 -7
- package/dist/common/uris/platform/types.d.cts +0 -13
- package/dist/common/utils.cjs +0 -98
- package/dist/common/utils.d.cts +0 -12
- package/dist/favicons/defaults.cjs +0 -65
- package/dist/favicons/defaults.d.cts +0 -18
- package/dist/favicons/extractors.cjs +0 -25
- package/dist/favicons/extractors.d.cts +0 -7
- package/dist/favicons/index.cjs +0 -29
- package/dist/favicons/index.d.cts +0 -7
- package/dist/favicons/platform/handlers/bluesky.cjs +0 -27
- package/dist/favicons/platform/handlers/codeberg.cjs +0 -19
- package/dist/favicons/platform/handlers/deviantart.cjs +0 -29
- package/dist/favicons/platform/handlers/devto.cjs +0 -31
- package/dist/favicons/platform/handlers/github.cjs +0 -19
- package/dist/favicons/platform/handlers/githubGist.cjs +0 -19
- package/dist/favicons/platform/handlers/gitlab.cjs +0 -38
- package/dist/favicons/platform/handlers/lobsters.cjs +0 -21
- package/dist/favicons/platform/handlers/mastodon.cjs +0 -40
- package/dist/favicons/platform/handlers/reddit.cjs +0 -42
- package/dist/favicons/platform/handlers/sourceforge.cjs +0 -21
- package/dist/favicons/platform/handlers/tumblr.cjs +0 -16
- package/dist/favicons/types.d.cts +0 -4
- package/dist/favicons/utils.cjs +0 -10
- package/dist/favicons.cjs +0 -12
- package/dist/favicons.d.cts +0 -4
- package/dist/feeds/defaults.cjs +0 -290
- package/dist/feeds/defaults.d.cts +0 -21
- package/dist/feeds/extractors.cjs +0 -46
- package/dist/feeds/extractors.d.cts +0 -7
- package/dist/feeds/index.cjs +0 -26
- package/dist/feeds/index.d.cts +0 -7
- package/dist/feeds/platform/handlers/acast.cjs +0 -26
- package/dist/feeds/platform/handlers/ameblo.cjs +0 -36
- package/dist/feeds/platform/handlers/applePodcasts.cjs +0 -26
- package/dist/feeds/platform/handlers/arena.cjs +0 -42
- package/dist/feeds/platform/handlers/artstation.cjs +0 -52
- package/dist/feeds/platform/handlers/audioboom.cjs +0 -23
- package/dist/feeds/platform/handlers/bearblog.cjs +0 -45
- package/dist/feeds/platform/handlers/behance.cjs +0 -56
- package/dist/feeds/platform/handlers/blogspot.cjs +0 -72
- package/dist/feeds/platform/handlers/bluesky.cjs +0 -20
- package/dist/feeds/platform/handlers/bookwyrm.cjs +0 -48
- package/dist/feeds/platform/handlers/buttondown.cjs +0 -43
- package/dist/feeds/platform/handlers/buzzsprout.cjs +0 -22
- package/dist/feeds/platform/handlers/codeberg.cjs +0 -69
- package/dist/feeds/platform/handlers/csdn.cjs +0 -20
- package/dist/feeds/platform/handlers/dailymotion.cjs +0 -86
- package/dist/feeds/platform/handlers/deviantart.cjs +0 -85
- package/dist/feeds/platform/handlers/devto.cjs +0 -58
- package/dist/feeds/platform/handlers/discourse.cjs +0 -70
- package/dist/feeds/platform/handlers/douban.cjs +0 -56
- package/dist/feeds/platform/handlers/dreamwidth.cjs +0 -48
- package/dist/feeds/platform/handlers/exblog.cjs +0 -35
- package/dist/feeds/platform/handlers/fireside.cjs +0 -24
- package/dist/feeds/platform/handlers/friendica.cjs +0 -44
- package/dist/feeds/platform/handlers/ghost.cjs +0 -30
- package/dist/feeds/platform/handlers/github.cjs +0 -122
- package/dist/feeds/platform/handlers/githubGist.cjs +0 -56
- package/dist/feeds/platform/handlers/gitlab.cjs +0 -98
- package/dist/feeds/platform/handlers/goodreads.cjs +0 -49
- package/dist/feeds/platform/handlers/hackernews.cjs +0 -21
- package/dist/feeds/platform/handlers/hashnode.cjs +0 -16
- package/dist/feeds/platform/handlers/hatenablog.cjs +0 -56
- package/dist/feeds/platform/handlers/hearthis.cjs +0 -32
- package/dist/feeds/platform/handlers/heyWorld.cjs +0 -18
- package/dist/feeds/platform/handlers/insanejournal.cjs +0 -69
- package/dist/feeds/platform/handlers/itchio.cjs +0 -111
- package/dist/feeds/platform/handlers/kickstarter.cjs +0 -22
- package/dist/feeds/platform/handlers/lemmy.cjs +0 -88
- package/dist/feeds/platform/handlers/letterboxd.cjs +0 -46
- package/dist/feeds/platform/handlers/libsyn.cjs +0 -25
- package/dist/feeds/platform/handlers/listed.cjs +0 -20
- package/dist/feeds/platform/handlers/livejournal.cjs +0 -68
- package/dist/feeds/platform/handlers/lobsters.cjs +0 -57
- package/dist/feeds/platform/handlers/mastodon.cjs +0 -74
- package/dist/feeds/platform/handlers/mataroa.cjs +0 -16
- package/dist/feeds/platform/handlers/medium.cjs +0 -68
- package/dist/feeds/platform/handlers/microblog.cjs +0 -55
- package/dist/feeds/platform/handlers/misskey.cjs +0 -40
- package/dist/feeds/platform/handlers/myanimelist.cjs +0 -43
- package/dist/feeds/platform/handlers/naverBlog.cjs +0 -21
- package/dist/feeds/platform/handlers/nebula.cjs +0 -68
- package/dist/feeds/platform/handlers/note.cjs +0 -53
- package/dist/feeds/platform/handlers/observable.cjs +0 -34
- package/dist/feeds/platform/handlers/odysee.cjs +0 -20
- package/dist/feeds/platform/handlers/pagecord.cjs +0 -16
- package/dist/feeds/platform/handlers/paragraph.cjs +0 -20
- package/dist/feeds/platform/handlers/pika.cjs +0 -35
- package/dist/feeds/platform/handlers/pinterest.cjs +0 -57
- package/dist/feeds/platform/handlers/pixelfed.cjs +0 -46
- package/dist/feeds/platform/handlers/pleroma.cjs +0 -34
- package/dist/feeds/platform/handlers/podbean.cjs +0 -29
- package/dist/feeds/platform/handlers/podigee.cjs +0 -29
- package/dist/feeds/platform/handlers/posthaven.cjs +0 -24
- package/dist/feeds/platform/handlers/producthunt.cjs +0 -29
- package/dist/feeds/platform/handlers/prose.cjs +0 -26
- package/dist/feeds/platform/handlers/qiita.cjs +0 -58
- package/dist/feeds/platform/handlers/reddit.cjs +0 -149
- package/dist/feeds/platform/handlers/rssCom.cjs +0 -20
- package/dist/feeds/platform/handlers/seesaa.cjs +0 -22
- package/dist/feeds/platform/handlers/soundcloud.cjs +0 -39
- package/dist/feeds/platform/handlers/sourceforge.cjs +0 -53
- package/dist/feeds/platform/handlers/spreaker.cjs +0 -21
- package/dist/feeds/platform/handlers/stackExchange.cjs +0 -64
- package/dist/feeds/platform/handlers/steam.cjs +0 -35
- package/dist/feeds/platform/handlers/substack.cjs +0 -23
- package/dist/feeds/platform/handlers/tildes.cjs +0 -41
- package/dist/feeds/platform/handlers/tistory.cjs +0 -16
- package/dist/feeds/platform/handlers/transistor.cjs +0 -29
- package/dist/feeds/platform/handlers/tumblr.cjs +0 -24
- package/dist/feeds/platform/handlers/v2ex.cjs +0 -35
- package/dist/feeds/platform/handlers/velog.cjs +0 -24
- package/dist/feeds/platform/handlers/vimeo.cjs +0 -75
- package/dist/feeds/platform/handlers/weblogLol.cjs +0 -26
- package/dist/feeds/platform/handlers/weebly.cjs +0 -25
- package/dist/feeds/platform/handlers/wordpress.cjs +0 -209
- package/dist/feeds/platform/handlers/wpengine.cjs +0 -10
- package/dist/feeds/platform/handlers/writeas.cjs +0 -51
- package/dist/feeds/platform/handlers/ximalaya.cjs +0 -20
- package/dist/feeds/platform/handlers/youtube.cjs +0 -97
- package/dist/feeds/platform/handlers/zenn.cjs +0 -54
- package/dist/feeds/types.d.cts +0 -9
- package/dist/feeds.cjs +0 -16
- package/dist/feeds.d.cts +0 -4
- package/dist/hubs/discover/index.cjs +0 -30
- package/dist/hubs/discover/index.d.cts +0 -7
- package/dist/hubs/discover/types.d.cts +0 -15
- package/dist/hubs/feed/index.cjs +0 -32
- package/dist/hubs/headers/index.cjs +0 -17
- package/dist/hubs/html/index.cjs +0 -28
- package/dist/hubs.cjs +0 -0
- package/dist/hubs.d.cts +0 -2
- package/dist/index.cjs +0 -13
- package/dist/index.d.cts +0 -8
- package/dist/methods.cjs +0 -15
- package/dist/methods.d.cts +0 -7
- package/dist/utils.cjs +0 -9
- package/dist/utils.d.cts +0 -3
package/dist/common/locales.cjs
DELETED
|
@@ -1,348 +0,0 @@
|
|
|
1
|
-
//#region src/common/locales.json
|
|
2
|
-
var errors = {
|
|
3
|
-
"platformMethodRequiresUrl": "Platform method requires url to be provided in input",
|
|
4
|
-
"feedMethodRequiresContent": "Feed method requires content to be provided in input",
|
|
5
|
-
"htmlMethodRequiresContent": "HTML method requires content to be provided in input",
|
|
6
|
-
"headersMethodRequiresHeaders": "Headers method requires headers to be provided in input",
|
|
7
|
-
"guessMethodRequiresUrl": "Guess method requires url to be provided in input"
|
|
8
|
-
};
|
|
9
|
-
var hints = {
|
|
10
|
-
"youtube:all": "All uploads",
|
|
11
|
-
"youtube:videos": "Videos",
|
|
12
|
-
"youtube:shorts": "Shorts",
|
|
13
|
-
"youtube:live": "Live streams",
|
|
14
|
-
"youtube:popular-videos": "Popular videos",
|
|
15
|
-
"youtube:popular-shorts": "Popular shorts",
|
|
16
|
-
"youtube:popular-live": "Popular live streams",
|
|
17
|
-
"youtube:member-videos": "Member videos",
|
|
18
|
-
"youtube:member-shorts": "Member shorts",
|
|
19
|
-
"youtube:member-live": "Member live streams",
|
|
20
|
-
"youtube:playlist": "Playlist",
|
|
21
|
-
"github:activity": "Activity",
|
|
22
|
-
"github:releases": "Releases",
|
|
23
|
-
"github:commits": "Commits",
|
|
24
|
-
"github:tags": "Tags",
|
|
25
|
-
"github:wiki": "Wiki",
|
|
26
|
-
"github:discussions": "Discussions",
|
|
27
|
-
"github:discussion-category": "Discussion category",
|
|
28
|
-
"github:branch-commits": "Branch commits",
|
|
29
|
-
"github:file-history": "File history",
|
|
30
|
-
"reddit:posts": "Posts",
|
|
31
|
-
"reddit:post-comments": "Post comments",
|
|
32
|
-
"reddit:comments": "Comments",
|
|
33
|
-
"reddit:multireddit": "Multireddit",
|
|
34
|
-
"reddit:user-submitted": "Submitted",
|
|
35
|
-
"reddit:user-comments": "Comments",
|
|
36
|
-
"reddit:search": "Search",
|
|
37
|
-
"reddit:wiki": "Wiki",
|
|
38
|
-
"reddit:subreddits": "Subreddits",
|
|
39
|
-
"gitlab:activity": "Activity",
|
|
40
|
-
"gitlab:releases": "Releases",
|
|
41
|
-
"gitlab:tags": "Tags",
|
|
42
|
-
"gitlab:issues": "Issues",
|
|
43
|
-
"gitlab:merge-requests": "Merge requests",
|
|
44
|
-
"gitlab:branch-commits": "Branch commits",
|
|
45
|
-
"codeberg:activity": "Activity",
|
|
46
|
-
"codeberg:releases": "Releases",
|
|
47
|
-
"codeberg:tags": "Tags",
|
|
48
|
-
"codeberg:branch-commits": "Branch commits",
|
|
49
|
-
"codeberg:file-history": "File history",
|
|
50
|
-
"wordpress:category-rss": "Category (RSS)",
|
|
51
|
-
"wordpress:category-atom": "Category (Atom)",
|
|
52
|
-
"wordpress:category-rdf": "Category (RDF)",
|
|
53
|
-
"wordpress:tag-rss": "Tag (RSS)",
|
|
54
|
-
"wordpress:tag-atom": "Tag (Atom)",
|
|
55
|
-
"wordpress:tag-rdf": "Tag (RDF)",
|
|
56
|
-
"wordpress:author-rss": "Author (RSS)",
|
|
57
|
-
"wordpress:author-atom": "Author (Atom)",
|
|
58
|
-
"wordpress:author-rdf": "Author (RDF)",
|
|
59
|
-
"wordpress:date-archive-rss": "Date archive (RSS)",
|
|
60
|
-
"wordpress:date-archive-atom": "Date archive (Atom)",
|
|
61
|
-
"wordpress:date-archive-rdf": "Date archive (RDF)",
|
|
62
|
-
"wordpress:posts-rss": "Posts (RSS)",
|
|
63
|
-
"wordpress:posts-rdf": "Posts (RDF)",
|
|
64
|
-
"wordpress:posts-atom": "Posts (Atom)",
|
|
65
|
-
"wordpress:comments-rss": "Comments (RSS)",
|
|
66
|
-
"wordpress:comments-rdf": "Comments (RDF)",
|
|
67
|
-
"wordpress:comments-atom": "Comments (Atom)",
|
|
68
|
-
"wordpress:post-comments-rss": "Post comments (RSS)",
|
|
69
|
-
"wordpress:post-comments-rdf": "Post comments (RDF)",
|
|
70
|
-
"wordpress:post-comments-atom": "Post comments (Atom)",
|
|
71
|
-
"blogspot:posts-atom": "Posts (Atom)",
|
|
72
|
-
"blogspot:posts-rss": "Posts (RSS)",
|
|
73
|
-
"blogspot:posts-summary-atom": "Posts summary (Atom)",
|
|
74
|
-
"blogspot:posts-summary-rss": "Posts summary (RSS)",
|
|
75
|
-
"blogspot:comments-atom": "Comments (Atom)",
|
|
76
|
-
"blogspot:comments-rss": "Comments (RSS)",
|
|
77
|
-
"blogspot:label-atom": "Label (Atom)",
|
|
78
|
-
"blogspot:label-rss": "Label (RSS)",
|
|
79
|
-
"blogspot:post-comments-atom": "Post comments (Atom)",
|
|
80
|
-
"blogspot:post-comments-rss": "Post comments (RSS)",
|
|
81
|
-
"behance:portfolio": "Portfolio",
|
|
82
|
-
"behance:appreciated": "Appreciated",
|
|
83
|
-
"behance:projects": "Featured projects",
|
|
84
|
-
"behance:featured": "Featured by Adobe",
|
|
85
|
-
"bluesky:posts": "Posts",
|
|
86
|
-
"dailymotion:videos": "Videos",
|
|
87
|
-
"dailymotion:playlist": "Playlist",
|
|
88
|
-
"dailymotion:channel": "Channel",
|
|
89
|
-
"dailymotion:trending": "Trending",
|
|
90
|
-
"dailymotion:search": "Search",
|
|
91
|
-
"deviantart:tag": "Tag",
|
|
92
|
-
"deviantart:favorites": "Favorites",
|
|
93
|
-
"deviantart:gallery": "Gallery",
|
|
94
|
-
"deviantart:deviations": "Deviations",
|
|
95
|
-
"deviantart:journal": "Journal",
|
|
96
|
-
"deviantart:daily-deviations": "Daily Deviations",
|
|
97
|
-
"deviantart:popular": "Popular",
|
|
98
|
-
"devto:posts": "Posts",
|
|
99
|
-
"devto:tag": "Tag",
|
|
100
|
-
"devto:community": "Community",
|
|
101
|
-
"devto:latest": "Latest",
|
|
102
|
-
"github-gist:gists": "Gists",
|
|
103
|
-
"github-gist:starred": "Starred",
|
|
104
|
-
"github-gist:forks": "Forks",
|
|
105
|
-
"github-gist:discover": "Discover",
|
|
106
|
-
"kickstarter:updates": "Updates",
|
|
107
|
-
"kickstarter:projects": "Projects",
|
|
108
|
-
"letterboxd:diary": "Diary",
|
|
109
|
-
"letterboxd:journal": "Journal",
|
|
110
|
-
"lobsters:tag": "Tag",
|
|
111
|
-
"lobsters:domain": "Domain",
|
|
112
|
-
"lobsters:stories": "Stories",
|
|
113
|
-
"lobsters:top": "Top stories",
|
|
114
|
-
"lobsters:newest": "Newest",
|
|
115
|
-
"lobsters:comments": "Comments",
|
|
116
|
-
"mastodon:posts": "Posts",
|
|
117
|
-
"mastodon:tag": "Tag",
|
|
118
|
-
"mastodon:tagged": "Tagged",
|
|
119
|
-
"mastodon:replies": "Posts with replies",
|
|
120
|
-
"mastodon:media": "Media",
|
|
121
|
-
"medium:posts": "Posts",
|
|
122
|
-
"medium:tag": "Tag",
|
|
123
|
-
"medium:tagged": "Tagged",
|
|
124
|
-
"medium:publication": "Publication",
|
|
125
|
-
"pinterest:pins": "Pins",
|
|
126
|
-
"pinterest:board": "Board",
|
|
127
|
-
"producthunt:topic": "Topic",
|
|
128
|
-
"producthunt:category": "Category",
|
|
129
|
-
"producthunt:products": "Products",
|
|
130
|
-
"soundcloud:tracks": "Tracks",
|
|
131
|
-
"stackexchange:tag": "Tag",
|
|
132
|
-
"stackexchange:question": "Question",
|
|
133
|
-
"stackexchange:user": "User",
|
|
134
|
-
"stackexchange:newest": "Newest questions",
|
|
135
|
-
"stackexchange:collective": "Collective",
|
|
136
|
-
"steam:news": "News",
|
|
137
|
-
"steam:news-global": "News (global)",
|
|
138
|
-
"steam:daily-deals": "Daily deals",
|
|
139
|
-
"steam:group": "Group",
|
|
140
|
-
"substack:newsletter": "Newsletter",
|
|
141
|
-
"tumblr:posts": "Posts",
|
|
142
|
-
"tumblr:tag": "Tag",
|
|
143
|
-
"goodreads:updates": "Updates",
|
|
144
|
-
"goodreads:reviews": "Reviews",
|
|
145
|
-
"goodreads:shelf": "Shelf",
|
|
146
|
-
"sourceforge:activity": "Recent activity",
|
|
147
|
-
"sourceforge:files": "File releases",
|
|
148
|
-
"sourceforge:news-rss": "News (RSS)",
|
|
149
|
-
"sourceforge:news-atom": "News (Atom)",
|
|
150
|
-
"sourceforge:discussion": "Discussion",
|
|
151
|
-
"sourceforge:discussion-atom": "Discussion (Atom)",
|
|
152
|
-
"sourceforge:project-feed": "Project feed",
|
|
153
|
-
"sourceforge:bugs": "Bugs",
|
|
154
|
-
"velog:posts": "Posts",
|
|
155
|
-
"velog:trending": "Trending",
|
|
156
|
-
"vimeo:videos": "Videos",
|
|
157
|
-
"vimeo:likes": "Likes",
|
|
158
|
-
"vimeo:channel": "Channel",
|
|
159
|
-
"vimeo:group": "Group",
|
|
160
|
-
"vimeo:album": "Album",
|
|
161
|
-
"hashnode:blog": "Blog",
|
|
162
|
-
"paragraph:blog": "Blog",
|
|
163
|
-
"hatenablog:posts-rss": "Posts (RSS)",
|
|
164
|
-
"hatenablog:posts-atom": "Posts (Atom)",
|
|
165
|
-
"hatenablog:category-rss": "Category (RSS)",
|
|
166
|
-
"hatenablog:category-atom": "Category (Atom)",
|
|
167
|
-
"hatenablog:author-rss": "Author (RSS)",
|
|
168
|
-
"hatenablog:author-atom": "Author (Atom)",
|
|
169
|
-
"itchio:devlog": "Devlog",
|
|
170
|
-
"itchio:games": "Games",
|
|
171
|
-
"itchio:tag": "Tag",
|
|
172
|
-
"itchio:platform": "Platform",
|
|
173
|
-
"itchio:genre": "Genre",
|
|
174
|
-
"itchio:made-with": "Made with",
|
|
175
|
-
"itchio:section": "Section",
|
|
176
|
-
"itchio:featured": "Featured",
|
|
177
|
-
"itchio:new": "New",
|
|
178
|
-
"itchio:sales": "Sales",
|
|
179
|
-
"itchio:blog": "Blog",
|
|
180
|
-
"csdn:blog": "Blog",
|
|
181
|
-
"douban:interests": "Interests",
|
|
182
|
-
"douban:reviews": "Reviews",
|
|
183
|
-
"douban:notes": "Notes",
|
|
184
|
-
"douban:subjectReviews": "Subject reviews",
|
|
185
|
-
"v2ex:index": "Index",
|
|
186
|
-
"v2ex:node": "Node",
|
|
187
|
-
"v2ex:member": "Member",
|
|
188
|
-
"v2ex:tab": "Tab",
|
|
189
|
-
"ximalaya:album": "Album",
|
|
190
|
-
"lemmy:community": "Community",
|
|
191
|
-
"lemmy:user": "User",
|
|
192
|
-
"lemmy:all": "All",
|
|
193
|
-
"lemmy:local": "Local",
|
|
194
|
-
"apple-podcasts:podcast": "Podcast",
|
|
195
|
-
"writeas:blog": "Blog",
|
|
196
|
-
"writeas:tag": "Tag",
|
|
197
|
-
"prose:blog": "Blog",
|
|
198
|
-
"prose:tag": "Tag",
|
|
199
|
-
"prose:discovery": "Discovery",
|
|
200
|
-
"pagecord:blog": "Blog",
|
|
201
|
-
"listed:blog": "Blog",
|
|
202
|
-
"fireside:podcast-rss": "Podcast (RSS)",
|
|
203
|
-
"fireside:podcast-json": "Podcast (JSON)",
|
|
204
|
-
"exblog:posts-rss": "Posts (RSS)",
|
|
205
|
-
"exblog:posts-atom": "Posts (Atom)",
|
|
206
|
-
"exblog:category-rss": "Category (RSS)",
|
|
207
|
-
"exblog:category-atom": "Category (Atom)",
|
|
208
|
-
"dreamwidth:posts-rss": "Posts (RSS)",
|
|
209
|
-
"dreamwidth:posts-atom": "Posts (Atom)",
|
|
210
|
-
"dreamwidth:posts-tag-rss": "Tag (RSS)",
|
|
211
|
-
"dreamwidth:posts-tag-atom": "Tag (Atom)",
|
|
212
|
-
"dreamwidth:userpics-atom": "Userpics (Atom)",
|
|
213
|
-
"buttondown:newsletter": "Newsletter",
|
|
214
|
-
"bearblog:posts-atom": "Posts (Atom)",
|
|
215
|
-
"bearblog:posts-rss": "Posts (RSS)",
|
|
216
|
-
"bearblog:tag-atom": "Tag (Atom)",
|
|
217
|
-
"bearblog:tag-rss": "Tag (RSS)",
|
|
218
|
-
"bearblog:discover-atom": "Trending (Atom)",
|
|
219
|
-
"bearblog:discover-rss": "Trending (RSS)",
|
|
220
|
-
"transistor:podcast": "Podcast",
|
|
221
|
-
"odysee:videos": "Videos",
|
|
222
|
-
"myanimelist:anime": "Anime list",
|
|
223
|
-
"myanimelist:manga": "Manga list",
|
|
224
|
-
"myanimelist:recently-watched": "Recently watched",
|
|
225
|
-
"myanimelist:recently-read": "Recently read",
|
|
226
|
-
"myanimelist:news": "News",
|
|
227
|
-
"myanimelist:featured": "Featured",
|
|
228
|
-
"hackernews:front": "Front page",
|
|
229
|
-
"hackernews:show": "Show HN",
|
|
230
|
-
"tistory:blog": "Blog",
|
|
231
|
-
"note:blog": "Blog",
|
|
232
|
-
"note:hashtag": "Hashtag",
|
|
233
|
-
"note:magazine": "Magazine",
|
|
234
|
-
"note:featured": "Featured",
|
|
235
|
-
"artstation:portfolio": "Portfolio",
|
|
236
|
-
"artstation:artwork": "Artwork",
|
|
237
|
-
"artstation:artwork-trending": "Artwork (Trending)",
|
|
238
|
-
"nebula:videos": "Videos",
|
|
239
|
-
"nebula:videos-plus": "Videos (Plus)",
|
|
240
|
-
"nebula:videos-all": "All Videos",
|
|
241
|
-
"nebula:videos-all-plus": "All Videos (Plus)",
|
|
242
|
-
"nebula:category": "Category",
|
|
243
|
-
"nebula:category-plus": "Category (Plus)",
|
|
244
|
-
"nebula:channels": "Recently Added Channels",
|
|
245
|
-
"acast:podcast": "Podcast",
|
|
246
|
-
"ameblo:posts-rss": "Posts (RSS)",
|
|
247
|
-
"ameblo:posts-atom": "Posts (Atom)",
|
|
248
|
-
"ameblo:posts-rdf": "Posts (RDF)",
|
|
249
|
-
"arena:profile": "Profile",
|
|
250
|
-
"arena:channel": "Channel",
|
|
251
|
-
"arena:editorial": "Editorial",
|
|
252
|
-
"audioboom:podcast": "Podcast",
|
|
253
|
-
"bookwyrm:activity": "Activity",
|
|
254
|
-
"bookwyrm:reviews": "Reviews",
|
|
255
|
-
"bookwyrm:quotes": "Quotes",
|
|
256
|
-
"bookwyrm:comments": "Comments",
|
|
257
|
-
"bookwyrm:shelf": "Shelf",
|
|
258
|
-
"buzzsprout:podcast": "Podcast",
|
|
259
|
-
"discourse:latest": "Latest",
|
|
260
|
-
"discourse:posts": "Latest posts",
|
|
261
|
-
"discourse:top": "Top",
|
|
262
|
-
"discourse:category": "Category",
|
|
263
|
-
"discourse:topic": "Topic",
|
|
264
|
-
"discourse:activity": "Activity",
|
|
265
|
-
"friendica:posts": "Posts",
|
|
266
|
-
"friendica:comments": "Comments",
|
|
267
|
-
"friendica:replies": "Replies",
|
|
268
|
-
"friendica:activity": "Activity",
|
|
269
|
-
"ghost:blog": "Blog",
|
|
270
|
-
"ghost:tag": "Tag",
|
|
271
|
-
"ghost:author": "Author",
|
|
272
|
-
"hearthis:tracks": "Tracks",
|
|
273
|
-
"hey-world:blog": "Blog",
|
|
274
|
-
"insanejournal:posts-rss": "Posts (RSS)",
|
|
275
|
-
"insanejournal:posts-atom": "Posts (Atom)",
|
|
276
|
-
"insanejournal:posts-tag-rss": "Tag (RSS)",
|
|
277
|
-
"insanejournal:posts-tag-atom": "Tag (Atom)",
|
|
278
|
-
"insanejournal:userpics-atom": "Userpics (Atom)",
|
|
279
|
-
"libsyn:podcast": "Podcast",
|
|
280
|
-
"livejournal:posts-rss": "Posts (RSS)",
|
|
281
|
-
"livejournal:posts-atom": "Posts (Atom)",
|
|
282
|
-
"livejournal:posts-tag-rss": "Tag (RSS)",
|
|
283
|
-
"livejournal:posts-tag-atom": "Tag (Atom)",
|
|
284
|
-
"livejournal:userpics-atom": "Userpics (Atom)",
|
|
285
|
-
"mataroa:blog": "Blog",
|
|
286
|
-
"microblog:posts-rss": "Posts (RSS)",
|
|
287
|
-
"microblog:posts-json": "Posts (JSON)",
|
|
288
|
-
"microblog:podcast": "Podcast",
|
|
289
|
-
"microblog:podcast-json": "Podcast (JSON)",
|
|
290
|
-
"microblog:category-rss": "Category (RSS)",
|
|
291
|
-
"microblog:category-json": "Category (JSON)",
|
|
292
|
-
"microblog:archive": "Archive",
|
|
293
|
-
"microblog:photos": "Photos",
|
|
294
|
-
"microblog:replies": "Replies",
|
|
295
|
-
"misskey:posts-atom": "Posts (Atom)",
|
|
296
|
-
"misskey:posts-rss": "Posts (RSS)",
|
|
297
|
-
"misskey:posts-json": "Posts (JSON)",
|
|
298
|
-
"naver-blog:blog": "Blog",
|
|
299
|
-
"observable:notebooks": "Notebooks",
|
|
300
|
-
"observable:collection": "Collection",
|
|
301
|
-
"observable:recent": "Recent",
|
|
302
|
-
"observable:trending": "Trending",
|
|
303
|
-
"pika:posts-atom": "Posts (Atom)",
|
|
304
|
-
"pika:posts-rss": "Posts (RSS)",
|
|
305
|
-
"pika:tag-atom": "Tag (Atom)",
|
|
306
|
-
"pika:tag-rss": "Tag (RSS)",
|
|
307
|
-
"pixelfed:posts": "Posts",
|
|
308
|
-
"pleroma:posts": "Posts",
|
|
309
|
-
"pleroma:posts-rss": "Posts (RSS)",
|
|
310
|
-
"podbean:podcast": "Podcast",
|
|
311
|
-
"podigee:podcast": "Podcast",
|
|
312
|
-
"posthaven:posts": "Posts",
|
|
313
|
-
"posthaven:tag": "Tag",
|
|
314
|
-
"qiita:posts": "Posts",
|
|
315
|
-
"qiita:tag": "Tag",
|
|
316
|
-
"qiita:organization": "Organization",
|
|
317
|
-
"qiita:popular": "Popular items",
|
|
318
|
-
"qiita:zine": "Qiita Zine",
|
|
319
|
-
"rss-com:podcast": "Podcast",
|
|
320
|
-
"seesaa:posts-rss2": "Posts (RSS 2.0)",
|
|
321
|
-
"seesaa:posts-rdf": "Posts (RDF)",
|
|
322
|
-
"spreaker:podcast": "Podcast",
|
|
323
|
-
"tildes:topics-rss": "Topics (RSS)",
|
|
324
|
-
"tildes:topics-atom": "Topics (Atom)",
|
|
325
|
-
"tildes:group-rss": "Group (RSS)",
|
|
326
|
-
"tildes:group-atom": "Group (Atom)",
|
|
327
|
-
"weblog-lol:posts-rss": "Posts (RSS)",
|
|
328
|
-
"weblog-lol:posts-atom": "Posts (Atom)",
|
|
329
|
-
"weblog-lol:posts-json": "Posts (JSON)",
|
|
330
|
-
"weebly:blog": "Blog",
|
|
331
|
-
"zenn:posts": "Posts",
|
|
332
|
-
"zenn:topic": "Topic",
|
|
333
|
-
"zenn:publication": "Publication",
|
|
334
|
-
"zenn:trending": "Trending"
|
|
335
|
-
};
|
|
336
|
-
//#endregion
|
|
337
|
-
Object.defineProperty(exports, "errors", {
|
|
338
|
-
enumerable: true,
|
|
339
|
-
get: function() {
|
|
340
|
-
return errors;
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
Object.defineProperty(exports, "hints", {
|
|
344
|
-
enumerable: true,
|
|
345
|
-
get: function() {
|
|
346
|
-
return hints;
|
|
347
|
-
}
|
|
348
|
-
});
|
package/dist/common/types.cjs
DELETED
package/dist/common/types.d.cts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { FeedMethodOptions } from "./uris/feed/types.cjs";
|
|
2
|
-
import { GuessMethodOptions } from "./uris/guess/types.cjs";
|
|
3
|
-
import { HeadersMethodOptions } from "./uris/headers/types.cjs";
|
|
4
|
-
import { HtmlMethodOptions } from "./uris/html/types.cjs";
|
|
5
|
-
import { PlatformMethodOptions } from "./uris/platform/types.cjs";
|
|
6
|
-
|
|
7
|
-
//#region src/common/types.d.ts
|
|
8
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
9
|
-
type Pattern = string | RegExp;
|
|
10
|
-
type UriEntry = string | Array<string>;
|
|
11
|
-
type DiscoverUriHint = {
|
|
12
|
-
key: string;
|
|
13
|
-
label: string;
|
|
14
|
-
};
|
|
15
|
-
type DiscoverUriEntry = {
|
|
16
|
-
uri: UriEntry;
|
|
17
|
-
hint?: DiscoverUriHint;
|
|
18
|
-
};
|
|
19
|
-
declare const discoverMethodOrder: readonly ["platform", "feed", "html", "headers", "guess"];
|
|
20
|
-
type DiscoverMethod = (typeof discoverMethodOrder)[number];
|
|
21
|
-
type LinkSelector = {
|
|
22
|
-
rel: string;
|
|
23
|
-
types?: Array<string>;
|
|
24
|
-
};
|
|
25
|
-
type DiscoverResolveUrlFn = (url: string, baseUrl: string | undefined) => string | undefined;
|
|
26
|
-
type DiscoverResolveSiteUrlFn = (input: DiscoverInputObject, resolveUrlFn: DiscoverResolveUrlFn) => string | undefined;
|
|
27
|
-
type DiscoverFetchFnOptions = {
|
|
28
|
-
method?: 'GET' | 'HEAD';
|
|
29
|
-
headers?: Record<string, string>;
|
|
30
|
-
};
|
|
31
|
-
type DiscoverFetchFnResponse = {
|
|
32
|
-
headers: Headers;
|
|
33
|
-
body: string | ReadableStream<Uint8Array>;
|
|
34
|
-
url: string;
|
|
35
|
-
status: number;
|
|
36
|
-
statusText: string;
|
|
37
|
-
};
|
|
38
|
-
type DiscoverFetchFn = (url: string, options?: DiscoverFetchFnOptions) => MaybePromise<DiscoverFetchFnResponse>;
|
|
39
|
-
type DiscoverProgress = {
|
|
40
|
-
tested: number;
|
|
41
|
-
total: number;
|
|
42
|
-
found: number;
|
|
43
|
-
current: string;
|
|
44
|
-
};
|
|
45
|
-
type DiscoverOnProgressFn = (progress: DiscoverProgress) => void;
|
|
46
|
-
type DiscoverResult<TValid = object> = ({
|
|
47
|
-
url: string;
|
|
48
|
-
isValid: true;
|
|
49
|
-
method?: DiscoverMethod;
|
|
50
|
-
hint?: DiscoverUriHint;
|
|
51
|
-
} & TValid) | {
|
|
52
|
-
url: string;
|
|
53
|
-
isValid: false;
|
|
54
|
-
method?: DiscoverMethod;
|
|
55
|
-
hint?: DiscoverUriHint;
|
|
56
|
-
error?: unknown;
|
|
57
|
-
};
|
|
58
|
-
type DiscoverExtractFn<TValid> = (input: {
|
|
59
|
-
url: string;
|
|
60
|
-
content: string;
|
|
61
|
-
headers?: Headers;
|
|
62
|
-
status?: number;
|
|
63
|
-
}) => MaybePromise<DiscoverResult<TValid>>;
|
|
64
|
-
type DiscoverInputObject = {
|
|
65
|
-
url: string;
|
|
66
|
-
content?: string;
|
|
67
|
-
headers?: Headers;
|
|
68
|
-
};
|
|
69
|
-
type DiscoverInput = string | DiscoverInputObject;
|
|
70
|
-
type DiscoverMethodsConfig<TMethods extends DiscoverMethod = DiscoverMethod> = Array<TMethods> | Pick<{
|
|
71
|
-
platform?: true | Partial<PlatformMethodOptions>;
|
|
72
|
-
feed?: true | Partial<FeedMethodOptions>;
|
|
73
|
-
html?: true | Partial<Omit<HtmlMethodOptions, 'baseUrl'>>;
|
|
74
|
-
headers?: true | Partial<Omit<HeadersMethodOptions, 'baseUrl'>>;
|
|
75
|
-
guess?: true | Partial<Omit<GuessMethodOptions, 'baseUrl'>>;
|
|
76
|
-
}, TMethods>;
|
|
77
|
-
type DiscoverOptions<TValid, TMethods extends DiscoverMethod = DiscoverMethod> = {
|
|
78
|
-
methods?: DiscoverMethodsConfig<TMethods>;
|
|
79
|
-
fetchFn?: DiscoverFetchFn;
|
|
80
|
-
extractFn?: DiscoverExtractFn<TValid>;
|
|
81
|
-
resolveUrlFn?: DiscoverResolveUrlFn;
|
|
82
|
-
resolveSiteUrlFn?: DiscoverResolveSiteUrlFn;
|
|
83
|
-
stopOnFirstMethod?: boolean;
|
|
84
|
-
stopOnFirstResult?: boolean;
|
|
85
|
-
concurrency?: number;
|
|
86
|
-
onProgress?: DiscoverOnProgressFn;
|
|
87
|
-
includeInvalid?: boolean;
|
|
88
|
-
};
|
|
89
|
-
//#endregion
|
|
90
|
-
export { DiscoverExtractFn, DiscoverFetchFn, DiscoverFetchFnOptions, DiscoverFetchFnResponse, DiscoverInput, DiscoverInputObject, DiscoverMethod, DiscoverMethodsConfig, DiscoverOnProgressFn, DiscoverOptions, DiscoverProgress, DiscoverResolveSiteUrlFn, DiscoverResolveUrlFn, DiscoverResult, DiscoverUriEntry, DiscoverUriHint, LinkSelector, MaybePromise, Pattern, UriEntry };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../utils.cjs");
|
|
2
|
-
let feedsmith = require("feedsmith");
|
|
3
|
-
//#region src/common/uris/feed/index.ts
|
|
4
|
-
const discoverUrisFromFeed = (content, options) => {
|
|
5
|
-
try {
|
|
6
|
-
const result = (0, feedsmith.parseFeed)(content);
|
|
7
|
-
return require_utils.omitEmpty(options.extractUrls(result));
|
|
8
|
-
} catch {}
|
|
9
|
-
return [];
|
|
10
|
-
};
|
|
11
|
-
//#endregion
|
|
12
|
-
exports.discoverUrisFromFeed = discoverUrisFromFeed;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { parseFeed } from "feedsmith";
|
|
2
|
-
|
|
3
|
-
//#region src/common/uris/feed/types.d.ts
|
|
4
|
-
type FeedMethodData = ReturnType<typeof parseFeed>;
|
|
5
|
-
type FeedMethodOptions = {
|
|
6
|
-
extractUrls: (params: FeedMethodData) => Array<string>;
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
|
-
export { FeedMethodOptions };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const require_utils = require("./utils.cjs");
|
|
2
|
-
//#region src/common/uris/guess/index.ts
|
|
3
|
-
const discoverUrisFromGuess = (options) => {
|
|
4
|
-
const { baseUrl, uris, additionalBaseUrls = [] } = options;
|
|
5
|
-
return require_utils.generateUrlCombinations([baseUrl, ...additionalBaseUrls], uris);
|
|
6
|
-
};
|
|
7
|
-
//#endregion
|
|
8
|
-
exports.discoverUrisFromGuess = discoverUrisFromGuess;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { GuessMethodOptions } from "./types.cjs";
|
|
2
|
-
import { UriEntry } from "../../types.cjs";
|
|
3
|
-
|
|
4
|
-
//#region src/common/uris/guess/index.d.ts
|
|
5
|
-
declare const discoverUrisFromGuess: (options: GuessMethodOptions) => Array<UriEntry>;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { discoverUrisFromGuess };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
//#region src/common/uris/guess/utils.ts
|
|
2
|
-
const ipAddressRegex = /^\d+\.\d+\.\d+\.\d+$/;
|
|
3
|
-
const resolveUri = (uri, base, origin, pathname) => {
|
|
4
|
-
if (uri.startsWith("/")) return `${origin}${uri}`;
|
|
5
|
-
if (uri.startsWith("?")) return `${origin}${pathname}${uri}`;
|
|
6
|
-
return new URL(uri, base).href;
|
|
7
|
-
};
|
|
8
|
-
const generateUrlCombinations = (baseUrls, uris) => {
|
|
9
|
-
return baseUrls.flatMap((base) => {
|
|
10
|
-
const parsed = new URL(base);
|
|
11
|
-
const origin = parsed.origin;
|
|
12
|
-
const pathname = parsed.pathname;
|
|
13
|
-
return uris.map((uri) => {
|
|
14
|
-
if (typeof uri === "string") return resolveUri(uri, base, origin, pathname);
|
|
15
|
-
return uri.map((alternative) => resolveUri(alternative, base, origin, pathname));
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
const getWwwCounterpart = (baseUrl) => {
|
|
20
|
-
const url = new URL(baseUrl);
|
|
21
|
-
const port = url.port ? `:${url.port}` : "";
|
|
22
|
-
if (url.hostname.startsWith("www.")) return `${url.protocol}//${url.hostname.slice(4)}${port}`;
|
|
23
|
-
return `${url.protocol}//www.${url.hostname}${port}`;
|
|
24
|
-
};
|
|
25
|
-
const getSubdomainVariants = (baseUrl, prefixes) => {
|
|
26
|
-
const url = new URL(baseUrl);
|
|
27
|
-
const hostname = url.hostname;
|
|
28
|
-
const isIpAddress = ipAddressRegex.test(hostname);
|
|
29
|
-
if (hostname === "localhost" || isIpAddress) return [];
|
|
30
|
-
const hostnameParts = hostname.split(".");
|
|
31
|
-
if (hostnameParts.length < 2) return [];
|
|
32
|
-
const rootDomain = hostnameParts.slice(-2).join(".");
|
|
33
|
-
const protocol = url.protocol;
|
|
34
|
-
const port = url.port ? `:${url.port}` : "";
|
|
35
|
-
return prefixes.map((prefix) => {
|
|
36
|
-
return `${protocol}//${prefix === "" ? rootDomain : `${prefix}.${rootDomain}`}${port}`;
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
//#endregion
|
|
40
|
-
exports.generateUrlCombinations = generateUrlCombinations;
|
|
41
|
-
exports.getSubdomainVariants = getSubdomainVariants;
|
|
42
|
-
exports.getWwwCounterpart = getWwwCounterpart;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { UriEntry } from "../../types.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/common/uris/guess/utils.d.ts
|
|
4
|
-
declare const generateUrlCombinations: (baseUrls: Array<string>, uris: Array<UriEntry>) => Array<UriEntry>;
|
|
5
|
-
declare const getWwwCounterpart: (baseUrl: string) => string;
|
|
6
|
-
declare const getSubdomainVariants: (baseUrl: string, prefixes: Array<string>) => Array<string>;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { generateUrlCombinations, getSubdomainVariants, getWwwCounterpart };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../utils.cjs");
|
|
2
|
-
//#region src/common/uris/headers/index.ts
|
|
3
|
-
const linkSplitRegex = /,(?=\s*<)/;
|
|
4
|
-
const urlRegex = /<([^<>]+)>/;
|
|
5
|
-
const relRegex = /rel\s*=\s*["']?([^"';,]+)["']?/i;
|
|
6
|
-
const typeRegex = /type\s*=\s*["']?([^"';,]+)["']?/i;
|
|
7
|
-
const discoverUrisFromHeaders = (headers, options) => {
|
|
8
|
-
const uris = /* @__PURE__ */ new Set();
|
|
9
|
-
const linkHeader = headers.get("link");
|
|
10
|
-
if (!linkHeader) return [];
|
|
11
|
-
const links = linkHeader.split(linkSplitRegex);
|
|
12
|
-
for (const link of links) {
|
|
13
|
-
const urlMatch = link.match(urlRegex);
|
|
14
|
-
const relMatch = link.match(relRegex);
|
|
15
|
-
const typeMatch = link.match(typeRegex);
|
|
16
|
-
if (!urlMatch) continue;
|
|
17
|
-
const url = urlMatch[1];
|
|
18
|
-
const rel = relMatch?.[1]?.toLowerCase();
|
|
19
|
-
const type = typeMatch?.[1];
|
|
20
|
-
if (!rel) continue;
|
|
21
|
-
if (require_utils.matchesAnyOfLinkSelectors(rel, type, options.linkSelectors)) uris.add(url);
|
|
22
|
-
}
|
|
23
|
-
return [...uris];
|
|
24
|
-
};
|
|
25
|
-
//#endregion
|
|
26
|
-
exports.discoverUrisFromHeaders = discoverUrisFromHeaders;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../utils.cjs");
|
|
2
|
-
//#region src/common/uris/html/handlers.ts
|
|
3
|
-
const handleOpenTag = (context, name, attribs, _isImplied) => {
|
|
4
|
-
if (name === "base" && context.baseHref === void 0) {
|
|
5
|
-
const href = attribs.href?.trim();
|
|
6
|
-
if (href) context.baseHref = href;
|
|
7
|
-
}
|
|
8
|
-
if (name === "link" && attribs.href) {
|
|
9
|
-
const rel = attribs.rel?.toLowerCase();
|
|
10
|
-
if (!rel) return;
|
|
11
|
-
if (require_utils.matchesAnyOfLinkSelectors(rel, attribs.type, context.options.linkSelectors)) context.discoveredUris.add(attribs.href);
|
|
12
|
-
}
|
|
13
|
-
if (name === "a" && attribs.href) {
|
|
14
|
-
const lowerHref = attribs.href.toLowerCase();
|
|
15
|
-
if (require_utils.includesAnyOf(lowerHref, context.options.anchorIgnoredUris)) {
|
|
16
|
-
context.currentAnchor.href = "";
|
|
17
|
-
context.currentAnchor.text = "";
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
context.currentAnchor.href = attribs.href;
|
|
21
|
-
context.currentAnchor.text = "";
|
|
22
|
-
if (require_utils.endsWithAnyOf(lowerHref, context.options.anchorUris)) context.discoveredUris.add(attribs.href);
|
|
23
|
-
if (context.options.anchorPathSegments?.length) {
|
|
24
|
-
let pathname;
|
|
25
|
-
try {
|
|
26
|
-
pathname = new URL(attribs.href, "https://feedscout.invalid").pathname;
|
|
27
|
-
} catch {}
|
|
28
|
-
if (pathname && require_utils.includesAnyOf(pathname, context.options.anchorPathSegments)) context.discoveredUris.add(attribs.href);
|
|
29
|
-
}
|
|
30
|
-
const ariaLabel = attribs["aria-label"];
|
|
31
|
-
const title = attribs.title;
|
|
32
|
-
if (ariaLabel && require_utils.includesAnyOf(ariaLabel, context.options.anchorLabels) || title && require_utils.includesAnyOf(title, context.options.anchorLabels)) context.discoveredUris.add(attribs.href);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
const handleText = (context, text) => {
|
|
36
|
-
if (context.currentAnchor.href) context.currentAnchor.text += text;
|
|
37
|
-
};
|
|
38
|
-
const handleCloseTag = (context, name, _isImplied) => {
|
|
39
|
-
if (name === "a" && context.currentAnchor.href && context.currentAnchor.text) {
|
|
40
|
-
if (require_utils.includesAnyOf(context.currentAnchor.text.toLowerCase().trim(), context.options.anchorLabels)) context.discoveredUris.add(context.currentAnchor.href);
|
|
41
|
-
context.currentAnchor.href = "";
|
|
42
|
-
context.currentAnchor.text = "";
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const createHtmlUrisHandlers = (context) => {
|
|
46
|
-
return {
|
|
47
|
-
onopentag: (name, attribs, isImplied) => {
|
|
48
|
-
return handleOpenTag(context, name, attribs, isImplied);
|
|
49
|
-
},
|
|
50
|
-
ontext: (text) => {
|
|
51
|
-
return handleText(context, text);
|
|
52
|
-
},
|
|
53
|
-
onclosetag: (name, isImplied) => {
|
|
54
|
-
return handleCloseTag(context, name, isImplied);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
//#endregion
|
|
59
|
-
exports.createHtmlUrisHandlers = createHtmlUrisHandlers;
|