First step: Discover a data source based on the home page of the news site
const { discoverPostSource, getPostList } = require("post-feed-reader")
// Looks for metadata pointing to the Wordpress REST API or Atom/RSS Feeds
const source = await discoverPostSource('https://www.nytimes.com');
Second step: Fetch the post list data
// Retrieves the posts from the given source
const list = await getPostList(source);
const techCrunchList = await getPostList(techCrunchSource, {
fillTextContents: true, // Automatically converts HTML contents into plain text
wordpress: {
fetchBlogInfo: true, // Ensures blog title, description and favicons are available for WordPress sources
},
});