feedsweep 1.0.0
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/LICENSE +21 -0
- package/README.md +70 -0
- package/dist/common.d.ts +11 -0
- package/dist/common.js +116 -0
- package/dist/defaults.d.ts +14 -0
- package/dist/defaults.js +127 -0
- package/dist/embeds/youtube.d.ts +9 -0
- package/dist/embeds/youtube.js +50 -0
- package/dist/index.d.ts +105 -0
- package/dist/index.js +118 -0
- package/dist/transforms/dom/fixLazyImages.d.ts +6 -0
- package/dist/transforms/dom/fixLazyImages.js +38 -0
- package/dist/transforms/dom/highlightCode.d.ts +7 -0
- package/dist/transforms/dom/highlightCode.js +30 -0
- package/dist/transforms/dom/injectEnclosureEmbedPlaceholders.d.ts +6 -0
- package/dist/transforms/dom/injectEnclosureEmbedPlaceholders.js +33 -0
- package/dist/transforms/dom/linkifyUrls.d.ts +6 -0
- package/dist/transforms/dom/linkifyUrls.js +45 -0
- package/dist/transforms/dom/mergeConsecutiveOneLinerPres.d.ts +6 -0
- package/dist/transforms/dom/mergeConsecutiveOneLinerPres.js +33 -0
- package/dist/transforms/dom/removeTrackingPixels.d.ts +6 -0
- package/dist/transforms/dom/removeTrackingPixels.js +59 -0
- package/dist/transforms/dom/replaceEmbedsWithPlaceholders.d.ts +6 -0
- package/dist/transforms/dom/replaceEmbedsWithPlaceholders.js +36 -0
- package/dist/transforms/dom/replacePreLineBreaks.d.ts +6 -0
- package/dist/transforms/dom/replacePreLineBreaks.js +13 -0
- package/dist/transforms/dom/resolveRelativeUrls.d.ts +6 -0
- package/dist/transforms/dom/resolveRelativeUrls.js +42 -0
- package/dist/transforms/dom/simplifyFigures.d.ts +6 -0
- package/dist/transforms/dom/simplifyFigures.js +27 -0
- package/dist/transforms/dom/stripComments.d.ts +6 -0
- package/dist/transforms/dom/stripComments.js +23 -0
- package/dist/transforms/dom/stripInterBlockBreaks.d.ts +6 -0
- package/dist/transforms/dom/stripInterBlockBreaks.js +18 -0
- package/dist/transforms/dom/stripParagraphBoundaryBreaks.d.ts +6 -0
- package/dist/transforms/dom/stripParagraphBoundaryBreaks.js +25 -0
- package/dist/transforms/dom/stripTrackingParams.d.ts +6 -0
- package/dist/transforms/dom/stripTrackingParams.js +22 -0
- package/dist/transforms/dom/trimPreWhitespace.d.ts +6 -0
- package/dist/transforms/dom/trimPreWhitespace.js +20 -0
- package/dist/transforms/dom/unwrapRedirectUrls.d.ts +7 -0
- package/dist/transforms/dom/unwrapRedirectUrls.js +28 -0
- package/dist/transforms/string/decodeDoubleEncodedTags.d.ts +6 -0
- package/dist/transforms/string/decodeDoubleEncodedTags.js +23 -0
- package/dist/transforms/string/paragraphizePlainText.d.ts +6 -0
- package/dist/transforms/string/paragraphizePlainText.js +10 -0
- package/dist/transforms/string/stripEmptyTags.d.ts +6 -0
- package/dist/transforms/string/stripEmptyTags.js +25 -0
- package/dist/transforms/string/stripOrphanedClosingTags.d.ts +6 -0
- package/dist/transforms/string/stripOrphanedClosingTags.js +28 -0
- package/dist/transforms/string/unwrapWrappers.d.ts +6 -0
- package/dist/transforms/string/unwrapWrappers.js +10 -0
- package/dist/types.d.ts +52 -0
- package/dist/unwraps/aceml.d.ts +6 -0
- package/dist/unwraps/aceml.js +17 -0
- package/dist/unwraps/adjust.d.ts +6 -0
- package/dist/unwraps/adjust.js +9 -0
- package/dist/unwraps/amazonAffiliate.d.ts +6 -0
- package/dist/unwraps/amazonAffiliate.js +9 -0
- package/dist/unwraps/ampCache.d.ts +6 -0
- package/dist/unwraps/ampCache.js +13 -0
- package/dist/unwraps/awin.d.ts +6 -0
- package/dist/unwraps/awin.js +9 -0
- package/dist/unwraps/bing.d.ts +6 -0
- package/dist/unwraps/bing.js +15 -0
- package/dist/unwraps/cjNetwork.d.ts +6 -0
- package/dist/unwraps/cjNetwork.js +17 -0
- package/dist/unwraps/digidip.d.ts +6 -0
- package/dist/unwraps/digidip.js +8 -0
- package/dist/unwraps/disqus.d.ts +6 -0
- package/dist/unwraps/disqus.js +8 -0
- package/dist/unwraps/douban.d.ts +6 -0
- package/dist/unwraps/douban.js +9 -0
- package/dist/unwraps/duckduckgo.d.ts +6 -0
- package/dist/unwraps/duckduckgo.js +9 -0
- package/dist/unwraps/ebayRover.d.ts +6 -0
- package/dist/unwraps/ebayRover.js +8 -0
- package/dist/unwraps/effiliation.d.ts +6 -0
- package/dist/unwraps/effiliation.js +8 -0
- package/dist/unwraps/embedly.d.ts +6 -0
- package/dist/unwraps/embedly.js +8 -0
- package/dist/unwraps/facebook.d.ts +6 -0
- package/dist/unwraps/facebook.js +9 -0
- package/dist/unwraps/feedsportal.d.ts +6 -0
- package/dist/unwraps/feedsportal.js +44 -0
- package/dist/unwraps/firebaseDynamicLinks.d.ts +6 -0
- package/dist/unwraps/firebaseDynamicLinks.js +8 -0
- package/dist/unwraps/flipboard.d.ts +6 -0
- package/dist/unwraps/flipboard.js +9 -0
- package/dist/unwraps/gateSc.d.ts +6 -0
- package/dist/unwraps/gateSc.js +8 -0
- package/dist/unwraps/georiot.d.ts +6 -0
- package/dist/unwraps/georiot.js +8 -0
- package/dist/unwraps/gitee.d.ts +6 -0
- package/dist/unwraps/gitee.js +9 -0
- package/dist/unwraps/google.d.ts +6 -0
- package/dist/unwraps/google.js +8 -0
- package/dist/unwraps/googleAmpViewer.d.ts +6 -0
- package/dist/unwraps/googleAmpViewer.js +13 -0
- package/dist/unwraps/googleNews.d.ts +6 -0
- package/dist/unwraps/googleNews.js +8 -0
- package/dist/unwraps/googleNewsModern.d.ts +6 -0
- package/dist/unwraps/googleNewsModern.js +11 -0
- package/dist/unwraps/googleScholar.d.ts +6 -0
- package/dist/unwraps/googleScholar.js +8 -0
- package/dist/unwraps/googleTranslate.d.ts +6 -0
- package/dist/unwraps/googleTranslate.js +8 -0
- package/dist/unwraps/hashnode.d.ts +6 -0
- package/dist/unwraps/hashnode.js +9 -0
- package/dist/unwraps/icptrack.d.ts +6 -0
- package/dist/unwraps/icptrack.js +9 -0
- package/dist/unwraps/idealoPartner.d.ts +6 -0
- package/dist/unwraps/idealoPartner.js +8 -0
- package/dist/unwraps/instagram.d.ts +6 -0
- package/dist/unwraps/instagram.js +8 -0
- package/dist/unwraps/jianshuGo.d.ts +6 -0
- package/dist/unwraps/jianshuGo.js +9 -0
- package/dist/unwraps/juejin.d.ts +6 -0
- package/dist/unwraps/juejin.js +8 -0
- package/dist/unwraps/leverAnalytics.d.ts +6 -0
- package/dist/unwraps/leverAnalytics.js +8 -0
- package/dist/unwraps/linksynergy.d.ts +6 -0
- package/dist/unwraps/linksynergy.js +9 -0
- package/dist/unwraps/mailchimp.d.ts +6 -0
- package/dist/unwraps/mailchimp.js +9 -0
- package/dist/unwraps/mailpanion.d.ts +6 -0
- package/dist/unwraps/mailpanion.js +8 -0
- package/dist/unwraps/mailpgn.d.ts +6 -0
- package/dist/unwraps/mailpgn.js +8 -0
- package/dist/unwraps/mailtrack.d.ts +6 -0
- package/dist/unwraps/mailtrack.js +8 -0
- package/dist/unwraps/medium.d.ts +6 -0
- package/dist/unwraps/medium.js +9 -0
- package/dist/unwraps/mimecast.d.ts +6 -0
- package/dist/unwraps/mimecast.js +11 -0
- package/dist/unwraps/mozillaOutgoing.d.ts +6 -0
- package/dist/unwraps/mozillaOutgoing.js +13 -0
- package/dist/unwraps/narrativ.d.ts +6 -0
- package/dist/unwraps/narrativ.js +8 -0
- package/dist/unwraps/nicoMs.d.ts +6 -0
- package/dist/unwraps/nicoMs.js +12 -0
- package/dist/unwraps/outlookSafelinks.d.ts +6 -0
- package/dist/unwraps/outlookSafelinks.js +8 -0
- package/dist/unwraps/partnerAds.d.ts +6 -0
- package/dist/unwraps/partnerAds.js +8 -0
- package/dist/unwraps/pocket.d.ts +6 -0
- package/dist/unwraps/pocket.js +9 -0
- package/dist/unwraps/postmark.d.ts +6 -0
- package/dist/unwraps/postmark.js +12 -0
- package/dist/unwraps/proofpointV1.d.ts +6 -0
- package/dist/unwraps/proofpointV1.js +16 -0
- package/dist/unwraps/proofpointV2.d.ts +6 -0
- package/dist/unwraps/proofpointV2.js +16 -0
- package/dist/unwraps/proofpointV3.d.ts +6 -0
- package/dist/unwraps/proofpointV3.js +78 -0
- package/dist/unwraps/pxf.d.ts +6 -0
- package/dist/unwraps/pxf.js +8 -0
- package/dist/unwraps/recruitics.d.ts +6 -0
- package/dist/unwraps/recruitics.js +8 -0
- package/dist/unwraps/redditOut.d.ts +6 -0
- package/dist/unwraps/redditOut.js +8 -0
- package/dist/unwraps/redirectingat.d.ts +6 -0
- package/dist/unwraps/redirectingat.js +8 -0
- package/dist/unwraps/segmentfault.d.ts +6 -0
- package/dist/unwraps/segmentfault.js +16 -0
- package/dist/unwraps/shareasale.d.ts +6 -0
- package/dist/unwraps/shareasale.js +9 -0
- package/dist/unwraps/sjv.d.ts +6 -0
- package/dist/unwraps/sjv.js +8 -0
- package/dist/unwraps/skimlinks.d.ts +6 -0
- package/dist/unwraps/skimlinks.js +8 -0
- package/dist/unwraps/slack.d.ts +6 -0
- package/dist/unwraps/slack.js +9 -0
- package/dist/unwraps/smartredirect.d.ts +6 -0
- package/dist/unwraps/smartredirect.js +8 -0
- package/dist/unwraps/sspai.d.ts +6 -0
- package/dist/unwraps/sspai.js +9 -0
- package/dist/unwraps/steamLinkfilter.d.ts +6 -0
- package/dist/unwraps/steamLinkfilter.js +9 -0
- package/dist/unwraps/telegramIv.d.ts +6 -0
- package/dist/unwraps/telegramIv.js +9 -0
- package/dist/unwraps/tradedoubler.d.ts +6 -0
- package/dist/unwraps/tradedoubler.js +9 -0
- package/dist/unwraps/tumblr.d.ts +6 -0
- package/dist/unwraps/tumblr.js +9 -0
- package/dist/unwraps/valuecommerce.d.ts +6 -0
- package/dist/unwraps/valuecommerce.js +9 -0
- package/dist/unwraps/viglink.d.ts +6 -0
- package/dist/unwraps/viglink.js +8 -0
- package/dist/unwraps/vkAway.d.ts +6 -0
- package/dist/unwraps/vkAway.js +9 -0
- package/dist/unwraps/webArchive.d.ts +6 -0
- package/dist/unwraps/webArchive.js +12 -0
- package/dist/unwraps/yahooSearch.d.ts +6 -0
- package/dist/unwraps/yahooSearch.js +12 -0
- package/dist/unwraps/yandexTurbo.d.ts +6 -0
- package/dist/unwraps/yandexTurbo.js +12 -0
- package/dist/unwraps/youtube.d.ts +6 -0
- package/dist/unwraps/youtube.js +9 -0
- package/dist/unwraps/zhihu.d.ts +6 -0
- package/dist/unwraps/zhihu.js +8 -0
- package/dist/utils.d.ts +13 -0
- package/dist/utils.js +31 -0
- package/package.json +58 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//#region src/unwraps/feedsportal.ts
|
|
2
|
+
const feedsportalPathRegex = /\/([0-9A-Za-z]{20,})\/story01\.htm$/;
|
|
3
|
+
const feedsportalAlphabet = {
|
|
4
|
+
A: "0",
|
|
5
|
+
B: ".",
|
|
6
|
+
C: "/",
|
|
7
|
+
D: "?",
|
|
8
|
+
E: "-",
|
|
9
|
+
F: "=",
|
|
10
|
+
G: "&",
|
|
11
|
+
H: ",",
|
|
12
|
+
I: "_",
|
|
13
|
+
J: "%",
|
|
14
|
+
K: "+",
|
|
15
|
+
L: "http://",
|
|
16
|
+
M: "https://",
|
|
17
|
+
N: ".com",
|
|
18
|
+
O: ".co.uk",
|
|
19
|
+
P: ";",
|
|
20
|
+
Q: "|",
|
|
21
|
+
R: ":",
|
|
22
|
+
S: "www.",
|
|
23
|
+
T: "#",
|
|
24
|
+
U: "$",
|
|
25
|
+
V: "~",
|
|
26
|
+
W: "!",
|
|
27
|
+
X: "(",
|
|
28
|
+
Y: ")",
|
|
29
|
+
Z: "Z"
|
|
30
|
+
};
|
|
31
|
+
const unwrapFeedsportal = (url) => {
|
|
32
|
+
const match = url.pathname.match(feedsportalPathRegex);
|
|
33
|
+
if (!match) return;
|
|
34
|
+
const decoded = match[1].split("0").map((chunk, index) => {
|
|
35
|
+
if (index === 0) return chunk;
|
|
36
|
+
const head = chunk[0];
|
|
37
|
+
const substitution = head ? feedsportalAlphabet[head] : void 0;
|
|
38
|
+
return substitution === void 0 ? `0${chunk}` : substitution + chunk.slice(1);
|
|
39
|
+
}).join("");
|
|
40
|
+
if (!decoded.startsWith("http://") && !decoded.startsWith("https://")) return;
|
|
41
|
+
return decoded;
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { unwrapFeedsportal };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createParamExtractor } from "../utils.js";
|
|
2
|
+
//#region src/unwraps/firebaseDynamicLinks.ts
|
|
3
|
+
const unwrapFirebaseDynamicLinks = createParamExtractor({
|
|
4
|
+
hosts: /\.page\.link$/,
|
|
5
|
+
params: ["link", "ofl"]
|
|
6
|
+
});
|
|
7
|
+
//#endregion
|
|
8
|
+
export { unwrapFirebaseDynamicLinks };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/unwraps/googleAmpViewer.ts
|
|
2
|
+
const googleAmpHostRegex = /^(?:www\.)?google\.(?:com|[a-z]{2,3}(?:\.[a-z]{2,3})?)$/;
|
|
3
|
+
const httpsPathRegex = /^\/amp\/s\/(.+)$/;
|
|
4
|
+
const httpPathRegex = /^\/amp\/(?!s\/)(.+)$/;
|
|
5
|
+
const unwrapGoogleAmpViewer = (url) => {
|
|
6
|
+
if (!googleAmpHostRegex.test(url.hostname)) return;
|
|
7
|
+
const httpsMatch = url.pathname.match(httpsPathRegex);
|
|
8
|
+
if (httpsMatch) return `https://${httpsMatch[1]}`;
|
|
9
|
+
const httpMatch = url.pathname.match(httpPathRegex);
|
|
10
|
+
if (httpMatch) return `http://${httpMatch[1]}`;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { unwrapGoogleAmpViewer };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isHostOf } from "feedscout/utils";
|
|
2
|
+
//#region src/unwraps/googleNewsModern.ts
|
|
3
|
+
const unwrapGoogleNewsModern = (url) => {
|
|
4
|
+
if (!isHostOf(url.href, "news.google.com")) return;
|
|
5
|
+
const match = url.pathname.match(/^\/(?:rss\/)?articles\/([\w-]+)/);
|
|
6
|
+
if (!match) return;
|
|
7
|
+
const padded = match[1].replace(/-/g, "+").replace(/_/g, "/");
|
|
8
|
+
return Buffer.from(padded, "base64").toString("latin1").match(/\x08\x13".+?(https?:\/\/[^\xd2]+)\xd2\x01/)?.[1];
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { unwrapGoogleNewsModern };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createParamExtractor } from "../utils.js";
|
|
2
|
+
const unwrapGoogleScholar = createParamExtractor({
|
|
3
|
+
hosts: /^scholar\.google\.(?:com|[a-z]{2,3}(?:\.[a-z]{2,3})?)$/,
|
|
4
|
+
path: "/scholar_url",
|
|
5
|
+
params: ["url"]
|
|
6
|
+
});
|
|
7
|
+
//#endregion
|
|
8
|
+
export { unwrapGoogleScholar };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createParamExtractor } from "../utils.js";
|
|
2
|
+
const unwrapGoogleTranslate = createParamExtractor({
|
|
3
|
+
hosts: /^translate\.google\.(?:com|[a-z]{2,3}(?:\.[a-z]{2,3})?)$/,
|
|
4
|
+
path: "/translate",
|
|
5
|
+
params: ["u"]
|
|
6
|
+
});
|
|
7
|
+
//#endregion
|
|
8
|
+
export { unwrapGoogleTranslate };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createParamExtractor } from "../utils.js";
|
|
2
|
+
//#region src/unwraps/icptrack.ts
|
|
3
|
+
const unwrapIcptrack = createParamExtractor({
|
|
4
|
+
hosts: "click.icptrack.com",
|
|
5
|
+
path: "/icp/relay.php",
|
|
6
|
+
params: ["destination"]
|
|
7
|
+
});
|
|
8
|
+
//#endregion
|
|
9
|
+
export { unwrapIcptrack };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createParamExtractor } from "../utils.js";
|
|
2
|
+
//#region src/unwraps/linksynergy.ts
|
|
3
|
+
const unwrapLinksynergy = createParamExtractor({
|
|
4
|
+
hosts: "click.linksynergy.com",
|
|
5
|
+
path: "/deeplink",
|
|
6
|
+
params: ["murl"]
|
|
7
|
+
});
|
|
8
|
+
//#endregion
|
|
9
|
+
export { unwrapLinksynergy };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/unwraps/mimecast.ts
|
|
2
|
+
const mimecastHostRegex = /\.mimecast\.com$/;
|
|
3
|
+
const unwrapMimecast = (url) => {
|
|
4
|
+
if (!mimecastHostRegex.test(url.hostname)) return;
|
|
5
|
+
const targetUrl = url.searchParams.get("url");
|
|
6
|
+
if (targetUrl) return targetUrl;
|
|
7
|
+
const targetDomain = url.searchParams.get("domain");
|
|
8
|
+
if (targetDomain) return `https://${targetDomain}`;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { unwrapMimecast };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/unwraps/mozillaOutgoing.ts
|
|
2
|
+
const pathRegex = /^\/v1\/[0-9a-f]{64}\/(.+)$/;
|
|
3
|
+
const mozillaOutgoingHosts = new Set(["outgoing.prod.mozaws.net", "prod.outgoing.prod.webservices.mozgcp.net"]);
|
|
4
|
+
const unwrapMozillaOutgoing = (url) => {
|
|
5
|
+
if (!mozillaOutgoingHosts.has(url.hostname)) return;
|
|
6
|
+
const match = url.pathname.match(pathRegex);
|
|
7
|
+
if (!match) return;
|
|
8
|
+
try {
|
|
9
|
+
return decodeURIComponent(match[1]);
|
|
10
|
+
} catch {}
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { unwrapMozillaOutgoing };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/unwraps/nicoMs.ts
|
|
2
|
+
const nicoMsRegex = /^\/((?:sm|nm|so|im)\w+)$/;
|
|
3
|
+
const unwrapNicoMs = (url) => {
|
|
4
|
+
if (url.hostname !== "nico.ms") return;
|
|
5
|
+
const match = url.pathname.match(nicoMsRegex);
|
|
6
|
+
if (!match) return;
|
|
7
|
+
const id = match[1];
|
|
8
|
+
if (id.startsWith("im")) return `https://seiga.nicovideo.jp/seiga/${id}`;
|
|
9
|
+
return `https://www.nicovideo.jp/watch/${id}`;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { unwrapNicoMs };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createParamExtractor } from "../utils.js";
|
|
2
|
+
//#region src/unwraps/outlookSafelinks.ts
|
|
3
|
+
const unwrapOutlookSafelinks = createParamExtractor({
|
|
4
|
+
hosts: /\.safelinks\.protection\.outlook\.com$/,
|
|
5
|
+
params: ["url"]
|
|
6
|
+
});
|
|
7
|
+
//#endregion
|
|
8
|
+
export { unwrapOutlookSafelinks };
|