Function: McpedlSearch()
McpedlSearch(
category
,page
):Promise
<McpedlEntry
[]>
Defined in: src/mcpedl-search/mcpedl.ts:36
This function searches MCPEDL.org for article titles and links based on a specified category and page number.
Parameters
category
-
Type:
McpedlCategory
The content category to search within, which may include options such as mods, maps, textures, and more.
page
-
Type:
number
-
Default:
1
The page number to scrape articles from, with 1 being the starting index.
Returns
-
Type:
Promise
<McpedlEntry
[]>A promise that resolves to an array of articles, each containing titles and corresponding URLs.
Example
import { McpedlSearch, McpedlCategory } from "mika-scraper";
const fetchArticles = async () => {
try {
const articles = await McpedlSearch(McpedlCategory.Mods, 1);
console.log(articles);
} catch (error) {
console.error("Error fetching articles:", error);
}
};
fetchArticles();
Last updated on