Files
RSSHub/lib/v2/itch/radar.js
Ethan Shen 9c0c864b9b feat(route): add itch.io (#9923)
* feat(route): add itch.io

* docs: fix typo

* docs: fix typo

* fix typo
2022-06-09 20:17:45 +08:00

29 lines
1012 B
JavaScript

module.exports = {
'itch.io': {
_name: 'itch.io',
'.': [
{
title: 'Browse',
docs: 'https://docs.rsshub.app/game.html#itch-io-browse',
source: ['/'],
target: (params, url) => `/itch${new URL(url).toString().split('itch.io').pop()}`,
},
{
title: 'Developer Logs',
docs: 'https://docs.rsshub.app/game.html#itch-io-developer-logs',
source: ['/'],
target: (params, url) => {
const matches = new URL(url).toString().match(/\/\/(.*?)\.itch\.io\/(.*?)\/devlog/);
return `/itch/devlog/${matches[1]}/${matches[2]}`;
},
},
{
title: 'Posts',
docs: 'https://docs.rsshub.app/game.html#itch-io-posts',
source: ['/t/:topic/:id'],
target: '/itch/posts/:topic/:id',
},
],
},
};