|
I see that this process isn't documented. Is there a way to do it? In my case, there's a specific page I want to create a route for by scraping the HTML, and it doesn't make sense to create a PR because it's a very specific page in my town. Thanks. |
Replies: 1 comment 4 replies
|
Hi @bdovaz! I'm Dosu and I’m helping the RSSHub team. You're right that this isn't well documented. Unfortunately, the official Docker image doesn't support mounting custom routes at runtime — routes are compiled into a static bundle at build time [1], so volume mounting doesn't work. Here are your two main options: Option 1: Build a custom Docker image (recommended)
You'll need to rebuild whenever you want to update RSSHub upstream, but for a personal scraping route this is the most straightforward approach. Option 2: Use RSSHub as an npm package RSSHub exposes a import { init, registerRoute } from 'rsshub';
await init();
registerRoute('mytown', {
path: '/events',
name: 'My Town Events',
handler: async (ctx) => ({
title: 'Town Events',
link: 'https://mytown.example.com',
item: [/* your scraped items */],
}),
});This still requires building your own Docker image to run it, but keeps your code separate from the RSSHub source. For your HTML scraping use case, you'd use To reply, just mention @dosu. Share context across your team and agents. Try Dosu. |
Yes, this is possible! The trick is that internally,
app.request(path)returns a full HTTPResponseobject containing RSS XML before therequest()wrapper parses it as JSON [1]. The template middleware handles all the Data→XML conversion [2].You can create a wrapper server like this: