kiwilan / feedrender

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

Home Page:https://feedrender.git-projects.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.git-projects.xyz

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

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.git-projects.xyz/api/render?url=https://2hdp.fr/2HDP.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.git-projects.xyz/api/json?url=https://2hdp.fr/2HDP.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.git-projects.xyz/api/xml?url=https://feedpress.me/rdvjeux

Installation

Docker

You can use docker compose or docker to run the application.

Docker compose

Create .env file

cp .env.example .env

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

docker compose up -d

Docker image

Build and run the docker image

docker build -t feedrender-app:latest .
docker run -it -p 3000:3000 feedrender-app:latest

Local

Download dependencies

pnpm i

Create .env file

cp .env.example .env

Run dev server

pnpm dev

Go to localhost:3000

Build

Build application

pnpm build

Local preview

pnpm start

You can use PM2 to run application in production.

Tests

Run tests

pnpm test

Credits

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

License

BSD 2-Clause

About

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

https://feedrender.git-projects.xyz

License:BSD 2-Clause "Simplified" License


Languages

Language:TypeScript 88.1%Language:CSS 10.6%Language:JavaScript 0.6%Language:Dockerfile 0.6%