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/cli.js
CHANGED
|
@@ -183,16 +183,20 @@ async function prefetchSiteData(domain) {
|
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
186
|
+
if (sitemapXml && sitemapXml.status === 200 && sitemapXml.text.includes("<sitemapindex")) {
|
|
187
|
+
const subUrls = extractAllSubSitemapUrls(sitemapXml.text, 5);
|
|
188
|
+
if (subUrls.length > 0) {
|
|
189
|
+
const subResults = await Promise.all(subUrls.map((u) => fetchText(u)));
|
|
190
|
+
for (const sub of subResults) {
|
|
191
|
+
if (sub && sub.status === 200) {
|
|
192
|
+
sitemapXml.text += "\n" + sub.text;
|
|
193
|
+
}
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
+
}
|
|
197
|
+
let blogSample = [];
|
|
198
|
+
if (sitemapXml && sitemapXml.status === 200) {
|
|
199
|
+
const sitemapForBlog = sitemapXml.text;
|
|
196
200
|
const blogUrls = extractBlogUrlsFromSitemap(sitemapForBlog, domain, 50);
|
|
197
201
|
if (blogUrls.length > 0) {
|
|
198
202
|
const fetched = await Promise.all(blogUrls.map((url) => fetchText(url)));
|
|
@@ -1237,16 +1241,16 @@ function extractBlogUrlsFromSitemap(sitemapText, domain, limit = 50) {
|
|
|
1237
1241
|
});
|
|
1238
1242
|
return candidates.slice(0, limit).map((c) => c.url);
|
|
1239
1243
|
}
|
|
1240
|
-
function
|
|
1241
|
-
if (!sitemapText.includes("<sitemapindex")) return
|
|
1244
|
+
function extractAllSubSitemapUrls(sitemapText, limit = 5) {
|
|
1245
|
+
if (!sitemapText.includes("<sitemapindex")) return [];
|
|
1242
1246
|
const sitemapLocs = sitemapText.match(/<sitemap>[\s\S]*?<loc>([^<]+)<\/loc>[\s\S]*?<\/sitemap>/gi) || [];
|
|
1243
|
-
if (sitemapLocs.length === 0) return null;
|
|
1244
1247
|
const urls = sitemapLocs.map((block) => {
|
|
1245
1248
|
const match = block.match(/<loc>([^<]+)<\/loc>/i);
|
|
1246
1249
|
return match ? match[1].trim() : "";
|
|
1247
1250
|
}).filter(Boolean);
|
|
1248
|
-
const preferred = urls.
|
|
1249
|
-
|
|
1251
|
+
const preferred = urls.filter((u) => /post|blog|article|page/i.test(u));
|
|
1252
|
+
const rest = urls.filter((u) => !preferred.includes(u));
|
|
1253
|
+
return [...preferred, ...rest].slice(0, limit);
|
|
1250
1254
|
}
|
|
1251
1255
|
function checkContentVelocity(data) {
|
|
1252
1256
|
const findings = [];
|