newCrawler({
appId: "YOUR APP ID HERE",
apiKey: "YOUR API KEY HERE",
rateLimit: 8,
sitemaps: ["https://www.algolia.com/blog/sitemap.xml"],
ignoreQueryParams: ["source", "utm_*"],
renderJavaScript: true,
actions: [
{
indexName: "YOUR INDEX NAME HERE",
pathsToMatch: [
"https://www.algolia.com/blog/**",
"https://algolia.com/blog/**",
],
recordExtractor: ({ url, $, contentLength, fileType }) => {
return [
{
objectID: url.href,
url: url.href,
title: $("h1.entry-title").text(),
description: $("meta[name=description]").attr("content"),
image: $('meta[property="og:image"]').attr("content"),
category: url.pathname.split("/")[2],
author: $("p.author-name").text(),
},
];
},
},
],
});