Skip to content
Discussion options

You must be logged in to vote

Yes, this is possible! The trick is that internally, app.request(path) returns a full HTTP Response object containing RSS XML before the request() wrapper parses it as JSON [1]. The template middleware handles all the Data→XML conversion [2].

You can create a wrapper server like this:

import { init, registerRoute } from 'rsshub';
import { createServer } from 'node:http';

await init();

// Register your custom route
await registerRoute('mytown', {
    path: '/events',
    name: 'Town Events',
    handler: async (ctx) => ({
        title: 'Town Events',
        link: 'https://mytown.example.com',
        item: [/* your scraped items */],
    }),
});

// The undocumented part: access the i…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@bdovaz
Comment options

@dosubot
Comment options

@bdovaz
Comment options

@dosubot
Comment options

Answer selected by bdovaz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant