diff --git a/docs/traditional-media.md b/docs/traditional-media.md
index 210a92200e..f352820deb 100644
--- a/docs/traditional-media.md
+++ b/docs/traditional-media.md
@@ -748,10 +748,13 @@ category 对应的关键词有
### 福建新闻
+
### 福州新闻
+
### 九江新闻
+
diff --git a/lib/router.js b/lib/router.js
index 4a6eed93a4..8384e717f3 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -3110,5 +3110,4 @@ router.get('/fjnews/fz/30', require('./routes/fjnews/fznews'));
// 九江新闻jjnews
router.get('/fjnews/jjnews', require('./routes/fjnews/jjnews'));
-
module.exports = router;
diff --git a/lib/routes/fjnews/fznews.js b/lib/routes/fjnews/fznews.js
index 5f41c9bcfb..68f60ca049 100644
--- a/lib/routes/fjnews/fznews.js
+++ b/lib/routes/fjnews/fznews.js
@@ -6,52 +6,50 @@ let host = 'http://news.fznews.com.cn/fzxw/';
let citytitle = '福州新闻';
module.exports = async (ctx) => {
- if (ctx.params.city === 'fj') {
- host = 'http://news.fznews.com.cn/dsxw/';
- citytitle = '福建新闻';
- } else {
- host = 'http://news.fznews.com.cn/fzxw/';
- citytitle = '福州新闻';
- }
+ if (ctx.params.city === 'fj') {
+ host = 'http://news.fznews.com.cn/dsxw/';
+ citytitle = '福建新闻';
+ } else {
+ host = 'http://news.fznews.com.cn/fzxw/';
+ citytitle = '福州新闻';
+ }
- const response = await got.get(host);
- const $ = cheerio.load(response.data);
- const list = $('.li-h32f14 li:not(.clearfix)').slice(0, ctx.params.limit).get();
- const out = await Promise.all(
+ const response = await got.get(host);
+ const $ = cheerio.load(response.data);
+ const list = $('.li-h32f14 li:not(.clearfix)').slice(0, ctx.params.limit).get();
+ const out = await Promise.all(
+ list.map(async (item) => {
+ const $ = cheerio.load(item);
+ const title = $('a').text();
+ const itemUrl = url.resolve(host, $('a').attr('href'));
- list.map(async (item) => {
- const $ = cheerio.load(item);
- const title = $('a').text();
- const itemUrl = url.resolve(host, $('a').attr('href'));
+ const cache = await ctx.cache.get(itemUrl);
+ if (cache) {
+ return Promise.resolve(JSON.parse(cache));
+ }
- const cache = await ctx.cache.get(itemUrl);
- if (cache) {
- return Promise.resolve(JSON.parse(cache));
- }
+ const res = await got.get(itemUrl);
+ const capture = cheerio.load(res.data);
+ const contents = capture('.zhengwen').html();
+ const time = capture('div.laiyuan div.left').text().substring(0, 19);
+ const author = capture('.laiyuan').text().replace('分享到:', '');
- const res = await got.get(itemUrl);
- const capture = cheerio.load(res.data);
- const contents = capture('.zhengwen').html();
- const time = capture('div.laiyuan div.left').text().substring(0, 19);
- const author = capture('.laiyuan').text().replace('分享到:', '');
+ const single = {
+ title,
+ link: itemUrl,
+ guid: itemUrl,
+ author: author,
+ description: contents,
+ pubDate: new Date(time).toUTCString(),
+ };
- const single = {
- title,
- link: itemUrl,
- guid: itemUrl,
- author: author,
- description: contents,
- pubDate: new Date(time).toUTCString(),
+ return Promise.resolve(single);
+ })
+ );
- };
-
- return Promise.resolve(single);
- })
- );
-
- ctx.state.data = {
- title: citytitle,
- link: host,
- item: out,
- };
+ ctx.state.data = {
+ title: citytitle,
+ link: host,
+ item: out,
+ };
};
diff --git a/lib/routes/fjnews/jjnews.js b/lib/routes/fjnews/jjnews.js
index 67e0f5a51f..89c72e302c 100644
--- a/lib/routes/fjnews/jjnews.js
+++ b/lib/routes/fjnews/jjnews.js
@@ -4,41 +4,40 @@ const url = require('url');
const host = 'http://tt.m.jxnews.com.cn/jjtop/';
module.exports = async (ctx) => {
- const response = await got.get(host);
- const $ = cheerio.load(response.data);
- const list = $('li.col-xs-12').get();
- const out = await Promise.all(
+ const response = await got.get(host);
+ const $ = cheerio.load(response.data);
+ const list = $('li.col-xs-12').get();
+ const out = await Promise.all(
+ list.map(async (item) => {
+ const $ = cheerio.load(item);
+ const title = $('.list-text-style').text();
+ const itemUrl = url.resolve(host, $('a').attr('href'));
- list.map(async (item) => {
- const $ = cheerio.load(item);
- const title = $('.list-text-style').text();
- const itemUrl = url.resolve(host, $('a').attr('href'));
+ const cache = await ctx.cache.get(itemUrl);
+ if (cache) {
+ return Promise.resolve(JSON.parse(cache));
+ }
- const cache = await ctx.cache.get(itemUrl);
- if (cache) {
- return Promise.resolve(JSON.parse(cache));
- }
+ const res = await got.get(itemUrl);
+ const capture = cheerio.load(res.data);
+ const contents = capture('content').html();
+ const time = capture('div.col-xs-8').text().substring(0, 19);
- const res = await got.get(itemUrl);
- const capture = cheerio.load(res.data);
- const contents = capture('content').html();
- const time = capture('div.col-xs-8').text().substring(0, 19);
+ const single = {
+ title,
+ link: itemUrl,
+ guid: itemUrl,
+ description: contents,
+ pubDate: new Date(time).toUTCString(),
+ };
- const single = {
- title,
- link: itemUrl,
- guid: itemUrl,
- description : contents,
- pubDate : new Date(time).toUTCString(),
- };
+ return Promise.resolve(single);
+ })
+ );
- return Promise.resolve(single);
- })
- );
-
- ctx.state.data = {
- title : '九江新闻',
- link : host,
- item : out,
- };
+ ctx.state.data = {
+ title: '九江新闻',
+ link: host,
+ item: out,
+ };
};