diff --git a/docs/other.md b/docs/other.md
index b78a8e189..bb0562597 100644
--- a/docs/other.md
+++ b/docs/other.md
@@ -457,3 +457,7 @@ type 为 all 时,category 参数不支持 cost 和 free
+
+### 艾瑞
+
+
diff --git a/lib/router.js b/lib/router.js
index 43925dace..1f9ddba63 100755
--- a/lib/router.js
+++ b/lib/router.js
@@ -1210,4 +1210,7 @@ router.get('/zju/career/:type', require('./routes/universities/zju/career'));
router.get('/infoq/recommend', require('./routes/infoq/recommend'));
router.get('/infoq/topic/:id', require('./routes/infoq/topic'));
+// 艾瑞
+router.get('/iresearch/report', require('./routes/iresearch/report'));
+
module.exports = router;
diff --git a/lib/routes/iresearch/report.js b/lib/routes/iresearch/report.js
new file mode 100644
index 000000000..60aa90184
--- /dev/null
+++ b/lib/routes/iresearch/report.js
@@ -0,0 +1,63 @@
+const axios = require('../../utils/axios');
+const date = require('../../utils/date');
+async function processReport(item, ctx) {
+ const apiUrl = `http://www.iresearch.com.cn/Detail/reportM?id=${item.NewsId}&isfree=0`;
+ const pageUrl = 'http://www.iresearch.com.cn/m/report.shtml';
+ const cache = await ctx.cache.get(apiUrl);
+ if (cache) {
+ return cache;
+ }
+ const response = await axios({
+ method: 'get',
+ url: apiUrl,
+ headers: {
+ Referer: pageUrl,
+ 'Content-Type': 'application/json',
+ },
+ });
+
+ const data = response.data.List[0];
+ let description = data.Content + '
';
+ const reportId = data.id;
+
+ for (let i = 1; i <= data.PagesCount; i++) {
+ description += `
`;
+ }
+
+ await ctx.cache.set(apiUrl, description, 24 * 60 * 60);
+ return description;
+}
+
+module.exports = async (ctx) => {
+ const apiUrl = 'http://www.iresearch.com.cn/products/GetReportList?classId=&fee=0&date=&lastId=&pageSize=6';
+ const pageUrl = 'http://www.iresearch.com.cn/m/report.shtml';
+
+ const resp = await axios({
+ method: 'get',
+ url: apiUrl,
+ headers: {
+ Referer: pageUrl,
+ 'Content-Type': 'application/json',
+ },
+ });
+
+ const list = resp.data.List;
+ const items = await Promise.all(
+ list.map(async (item) => {
+ const other = await processReport(item, ctx);
+ return {
+ title: item.Title,
+ description: other,
+ pubDate: date(item.Uptime),
+ link: item.VisitUrl,
+ };
+ })
+ );
+
+ ctx.state.data = {
+ title: '艾瑞产业研究报告',
+ link: pageUrl,
+ description: '艾瑞产业研究报告',
+ item: items,
+ };
+};
diff --git a/lib/utils/date.js b/lib/utils/date.js
index c235f2ab0..acf662173 100644
--- a/lib/utils/date.js
+++ b/lib/utils/date.js
@@ -50,6 +50,9 @@ module.exports = (html, timeZone = -serverOffset) => {
} else if (/(\d+)-(\d+)/.exec(html)) {
math = /(\d+)-(\d+)/.exec(html);
date = new Date(date.getFullYear(), parseInt(math[1]) - 1, math[2]);
+ } else if (/(\d+)\/(\d+)\/(\d+) (\d+):(\d+):(\d+)/.exec(html)) {
+ math = /(\d+)\/(\d+)\/(\d+) (\d+):(\d+):(\d+)/.exec(html);
+ date = new Date(math[1], parseInt(math[2]) - 1, math[3], math[4], math[5], math[6]);
} else if (/(\d+):(\d+)/.exec(html)) {
math = /(\d+):(\d+)/.exec(html);
date = new Date(date.getFullYear(), date.getMonth(), date.getDate(), math[1], math[2]);