aeorank 2.3.1 → 2.3.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/browser.js +17 -13
- package/dist/browser.js.map +1 -1
- package/dist/cli.js +17 -13
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +17 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -544,16 +544,20 @@ async function prefetchSiteData(domain) {
|
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
547
|
+
if (sitemapXml && sitemapXml.status === 200 && sitemapXml.text.includes("<sitemapindex")) {
|
|
548
|
+
const subUrls = extractAllSubSitemapUrls(sitemapXml.text, 5);
|
|
549
|
+
if (subUrls.length > 0) {
|
|
550
|
+
const subResults = await Promise.all(subUrls.map((u) => fetchText(u)));
|
|
551
|
+
for (const sub of subResults) {
|
|
552
|
+
if (sub && sub.status === 200) {
|
|
553
|
+
sitemapXml.text += "\n" + sub.text;
|
|
554
|
+
}
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
+
}
|
|
558
|
+
let blogSample = [];
|
|
559
|
+
if (sitemapXml && sitemapXml.status === 200) {
|
|
560
|
+
const sitemapForBlog = sitemapXml.text;
|
|
557
561
|
const blogUrls = extractBlogUrlsFromSitemap(sitemapForBlog, domain, 50);
|
|
558
562
|
if (blogUrls.length > 0) {
|
|
559
563
|
const fetched = await Promise.all(blogUrls.map((url) => fetchText(url)));
|
|
@@ -1598,16 +1602,16 @@ function extractBlogUrlsFromSitemap(sitemapText, domain, limit = 50) {
|
|
|
1598
1602
|
});
|
|
1599
1603
|
return candidates.slice(0, limit).map((c) => c.url);
|
|
1600
1604
|
}
|
|
1601
|
-
function
|
|
1602
|
-
if (!sitemapText.includes("<sitemapindex")) return
|
|
1605
|
+
function extractAllSubSitemapUrls(sitemapText, limit = 5) {
|
|
1606
|
+
if (!sitemapText.includes("<sitemapindex")) return [];
|
|
1603
1607
|
const sitemapLocs = sitemapText.match(/<sitemap>[\s\S]*?<loc>([^<]+)<\/loc>[\s\S]*?<\/sitemap>/gi) || [];
|
|
1604
|
-
if (sitemapLocs.length === 0) return null;
|
|
1605
1608
|
const urls = sitemapLocs.map((block) => {
|
|
1606
1609
|
const match = block.match(/<loc>([^<]+)<\/loc>/i);
|
|
1607
1610
|
return match ? match[1].trim() : "";
|
|
1608
1611
|
}).filter(Boolean);
|
|
1609
|
-
const preferred = urls.
|
|
1610
|
-
|
|
1612
|
+
const preferred = urls.filter((u) => /post|blog|article|page/i.test(u));
|
|
1613
|
+
const rest = urls.filter((u) => !preferred.includes(u));
|
|
1614
|
+
return [...preferred, ...rest].slice(0, limit);
|
|
1611
1615
|
}
|
|
1612
1616
|
function checkContentVelocity(data) {
|
|
1613
1617
|
const findings = [];
|