From 1467d5df9f4180d5b18a7954b280a6ad63ebfb1f Mon Sep 17 00:00:00 2001
From: umm233 <32997707+umm233@users.noreply.github.com>
Date: Wed, 19 Feb 2020 22:52:38 +0800
Subject: [PATCH] feat: add route for wolley.io (#4023)
---
docs/programming.md | 4 ++++
lib/router.js | 3 +++
lib/routes/wolley/index.js | 28 ++++++++++++++++++++++++++++
3 files changed, 35 insertions(+)
create mode 100644 lib/routes/wolley/index.js
diff --git a/docs/programming.md b/docs/programming.md
index 2fe154b318..1a585160b2 100644
--- a/docs/programming.md
+++ b/docs/programming.md
@@ -306,6 +306,10 @@ GitHub 官方也提供了一些 RSS:
+## wolley
+
+
+
## 阿里云
### 数据库内核月报
diff --git a/lib/router.js b/lib/router.js
index ffb022234f..7bd7e9177e 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -2262,4 +2262,7 @@ router.get('/neu/news/:type', require('./routes/universities/neu/news'));
// 稻草人书屋
router.get('/dcrsw/:name/:count?', require('./routes/novel/dcrsw'));
+// wolley
+router.get('/wolley', require('./routes/wolley/index'));
+
module.exports = router;
diff --git a/lib/routes/wolley/index.js b/lib/routes/wolley/index.js
new file mode 100644
index 0000000000..03d16bade1
--- /dev/null
+++ b/lib/routes/wolley/index.js
@@ -0,0 +1,28 @@
+const got = require('@/utils/got');
+
+module.exports = async (ctx) => {
+ const link = 'https://wolley.io/';
+
+ const response = await got({
+ method: 'get',
+ url: `https://wolley.io/api/submissions/list?page=1&limit=30`,
+ headers: {
+ Referer: link,
+ },
+ });
+
+ const data = response.data.data;
+
+ ctx.state.data = {
+ title: `wolley`,
+ link,
+ description: '',
+
+ item: data.map((item) => ({
+ title: item.title,
+ description: `post by ${item.user.handler}`,
+ pubDate: item.createdAt,
+ link: item.url,
+ })),
+ };
+};