Skip to content

API to render HTML from RSS feed. Built for podcast feeds, powered by unjs/h3.

License

Notifications You must be signed in to change notification settings

kiwilan/feedrender

Repository files navigation

Feedrender

Banner with microphone picture in background and Feedrender title

version h3 node Codecov License tests

API to render HTML from RSS feed. Built for podcast feeds, powered by unjs/h3.

Note

Demo is available at: feedrender.kiwilan.app

About

Some podcast services offer a RSS feed with HTML render if RSS feed is requested from a browser. These services (Acast, Ausha) are not open source and not free. This project is an attempt to create an open source alternative.

Features

  • 🌻 Render RSS feed as HTML on /api/render endpoint
    • 🔧 Option to return XML feed
    • 🗂️ Option to return JSON response with HTML as string
    • ✅ If crawler is not a browser, return original XML feed
  • 🗄️ Return a JSON response with RSS feed parsed as objects on /api/json endpoint
  • 🗒️ Return a XML response with RSS feed on /api/xml endpoint

Roadmap

  • Render RSS feed
  • Add option for apple podcast banner
  • Add color customization
  • Add feeds options for subscribe button
  • Add registering and token
  • Add cache
  • Better error handling
  • Add tests
  • Better locale support
  • Add CORS support

Docker

You can use docker compose to run the application.

Create .env file

cp .env.example .env
  • PORT: internal port of the container (default 3000)
  • HOST: host of the application
  • HTTPS: false (true or false)
  • ENV: environment (development, production, test)
  • APP_PORT: external port of the container (default 3000)

Docker compose will use the .env file to set environment variables.

docker compose down
docker compose up --build -d

Usage

Feedrender API offers some endpoints to execute different tasks.

Render

To render RSS feed, you can use the /render endpoint.

/api/render

Default behavior is to return HTML as page. You can use query parameters to change the response.

Query parameters

Name Required Type Default Description
url true string undefined URL of RSS feed, allow base64 URL
format false html, json html Type of response, default html will render HTML page, json will give JSON response with HTML string

Warning

If crawler is not a browser, response will be original XML feed.

Example: https://feedrender.kiwilan.app/api/render?url=http://zqsd.fr/zqsd.xml

JSON

To parse RSS feed, you can use the /json endpoint.

/api/json

Return a JSON response with Podcast object represent RSS feed.

Query parameters

Name Required Type Default Description
url true string undefined URL of RSS feed, allow base64 URL

Example: https://feedrender.kiwilan.app/api/json?url=http://zqsd.fr/zqsd.xml

XML

To parse show XML from RSS feed, you can use the /xml endpoint.

Note

Could be useful for RSS feed with only HTML render.

/api/xml

Return a JSON response with Podcast object represent RSS feed.

Query parameters

Name Required Type Default Description
url true string undefined URL of RSS feed, allow base64 URL

Example: https://feedrender.kiwilan.app/api/xml?url=http://zqsd.fr/zqsd.xml

Tests

Run tests

pnpm test

Credits

  • unjs: for unjs/h3 and unjs/ofetch
  • fast-xml-parser: for XML parsing
  • vue: for render functions used to render HTML

License

BSD 2-Clause