forked from DIYgod/RSSHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(route): weekendhk (DIYgod#12011)
- Loading branch information
Showing
5 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
'': ['TonyRL'], | ||
'/': ['TonyRL'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const got = require('@/utils/got'); | ||
const { parseDate } = require('@/utils/parse-date'); | ||
|
||
module.exports = async (ctx) => { | ||
const baseUrl = 'https://www.weekendhk.com'; | ||
const response = await got(`${baseUrl}/wp-json/wp/v2/posts`, { | ||
searchParams: { | ||
per_page: ctx.query.limit ?? 100, | ||
}, | ||
}); | ||
|
||
const items = response.data.map((item) => ({ | ||
title: item.title.rendered, | ||
link: item.link, | ||
guid: item.guid.rendered, | ||
description: item.content.rendered, | ||
pubDate: parseDate(item.date_gmt), | ||
author: item.creator_editor, | ||
})); | ||
|
||
ctx.state.data = { | ||
title: '新假期周刊', | ||
description: '新假期周刊網站為全港最強吃喝玩樂搵節目平台。網羅世界各地最詳盡旅遊潮流資訊;最新鮮熱辣本地飲食情報;最好玩周末玩樂節目,即時瞓身報導,全天候為你update。', | ||
link: baseUrl, | ||
language: 'zh-HK', | ||
image: `${baseUrl}/wp-content/themes/bucket/theme-content/images/196x196.png`, | ||
item: items, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = { | ||
'weekendhk.com': { | ||
_name: '新假期周刊', | ||
'.': [ | ||
{ | ||
title: '最新文章', | ||
docs: 'https://docs.rsshub.app/traditional-media.html#xin-jia-qi-zhou-kan', | ||
source: ['/'], | ||
target: '/weekendhk', | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = (router) => { | ||
router.get('/', require('./posts')); | ||
}; |