This is a simple Node.js and Express application that fetches and parses an RSS feed, allowing you to specify the number of entries and sort them in descending order by pubDate.
Make sure you have Node.js and npm installed on your machine.
# Install dependencies
npm install# Run the application
node app.jsEndpoint
GET /get-feed?url=RSS_FEED_URL&count=NUMBER_OF_ENTRIESReplace RSS_FEED_URL with the actual URL of the RSS feed you want to fetch. Optionally, you can include count in the query parameters to specify the number of entries to return.
# Fetch the RSS feed, return up to 5 entries, and sort them by pubDate
curl "http://localhost:3000/get-feed?url=https://example.com/rss-feed&count=5"The application includes CORS headers to allow requests from all origins.
- Express: Fast, unopinionated, minimalist web framework for Node.js.
- axios: Promise-based HTTP client for the browser and Node.js.
- xml2js: XML to JavaScript object converter.
This project is licensed under the MIT License.