feat(route): 增加茂名地方政府网站 (#11239)
* feat(route): 增加茂名地方政府网站 * docs: 删除无关文档 * fix: 删除暂时未使用的路由 * feat: 增加从多个选择器中获取正文的功能 * fix: Avoid unnecessary redirects * fix: 修复公开目录平台存在未使用的列表元素问题 * fix: 修复茂南页面列表中存在其他网站导致获取到空值的问题 * feat: 增加处理微信文章链接 * fix: 修复公开目录平台存在非文章链接的问题 * docs: 对维护者列表进行排序 * feat: 适配更多茂名政府网站页面 * feat: 适配更多茂名政府网站页面 * fix: 修复茂南的缓存问题 * feat: 使用 API 获取政策解读平台内容 * feat: 政策解读平台模板增加涉企信息 * feat: 政策解读平台模版增加样式 * fix: 修复政策解读平台解读条目缺失换行的问题 * docs: fix missing closing tag * fix: 修复茂名市相关网站浏览器扩展匹配规则缺失域名部分的问题 * docs: 修改部分要填充内容的描述 * docs: 修改名称与文档一致 * docs: 修改茂名市相关网站层级
This commit is contained in:
parent
6624c1c89d
commit
f6ab7b6ac9
|
|
@ -202,6 +202,132 @@ pageClass: routes
|
|||
|
||||
</Route>
|
||||
|
||||
## 茂名市人民政府
|
||||
|
||||
### 茂名市人民政府门户网站
|
||||
|
||||
<Route author="ShuiHuo" example="/gov/maoming/www/zwgk/zcjd/jd" path="/gov/maoming/:path+" :paramsDesc="['路径']">
|
||||
|
||||
::: tip 提示
|
||||
|
||||
路径处填写对应页面 URL 中茂名有关政府网站的域名最前面的部分和域名后的字段。下面是一个例子。
|
||||
|
||||
若订阅 [茂名市人民政府门户网站 > 政务公开 > 政策解读](http://www.maoming.gov.cn/zwgk/zcjd/jd/) 则将对应页面 URL <http://www.maoming.gov.cn/zwgk/zcjd/jd/> 中 `http://www.maoming.gov.cn/` 的字段 `www` 和 `/zwgk/zcjd/jd/` 作为路径填入。此时路由为 [`/gov/maoming/www/zwgk/zcjd/jd/`](https://rsshub.app/gov/maoming/www/zwgk/zcjd/jd/)
|
||||
|
||||
若订阅 [茂名市农业农村局网站 > 政务区 > 政务公开 > 通知公告](http://mmny.maoming.gov.cn/zwq/zwgk/tzgg/) 则将对应页面 URL <http://mmny.maoming.gov.cn/zwq/zwgk/tzgg/> 中 `http://mmny.maoming.gov.cn/` 的字段 `mmny` 和 `/zwq/zwgk/tzgg/` 作为路径填入。此时路由为 [`/gov/maoming/mmny/zwq/zwgk/tzgg/`](https://rsshub.app/gov/maoming/mmny/zwq/zwgk/tzgg/)
|
||||
|
||||
:::
|
||||
|
||||
</Route>
|
||||
|
||||
### 茂名市茂南区人民政府
|
||||
|
||||
<Route author="ShuiHuo" example="/gov/maonan/zwgk" path="/gov/maonan/:category" :paramsDesc="['分类名']">
|
||||
|
||||
| 政务公开 | 政务新闻 | 茂南动态 | 重大会议 | 公告公示 | 招录信息 | 政策解读 |
|
||||
| :--: | :--: | :--: | :--: | :--: | :--: | :--: |
|
||||
| zwgk | zwxw | mndt | zdhy | tzgg | zlxx | zcjd |
|
||||
|
||||
</Route>
|
||||
|
||||
### 茂名市电白区人民政府
|
||||
|
||||
<Route author="ShuiHuo" example="/gov/dianbai/www/zwgk/zcjd" path="/gov/dianbai/:path+" :paramsDesc="['路径,只填写 `www` 默认为 政务公开 > 政策解读']">
|
||||
|
||||
::: tip 提示
|
||||
|
||||
路径处填写对应页面 URL 中最前面的部分和域名后的字段。下面是一个例子。
|
||||
|
||||
若订阅 [政务公开 > 政策解读](http://www.dianbai.gov.cn/zwgk/zcjd/) 则将对应页面 URL <http://www.dianbai.gov.cn/zwgk/zcjd/> 中 `http://www.dianbai.gov.cn/` 的字段`www` 和 `zwgk/zcjd/` 作为路径填入。此时路由为 [`/gov/dianbai/www/zwgk/zcjd/`](https://rsshub.app/gov/dianbai/www/zwgk/zcjd/)
|
||||
|
||||
:::
|
||||
|
||||
</Route>
|
||||
|
||||
### 信宜市人民政府
|
||||
|
||||
<Route author="ShuiHuo" example="/gov/xinyi/www/zwgk/zcjd" path="/gov/xinyi/:path+" :paramsDesc="['路径,只填写 `www` 默认为 政务公开 > 政策解读']">
|
||||
|
||||
::: tip 提示
|
||||
|
||||
路径处填写对应页面 URL 中最前面的部分和域名后的字段。下面是一个例子。
|
||||
|
||||
若订阅 [政务公开 > 政策解读](http://www.xinyi.gov.cn/zwgk/zcjd/) 则将对应页面 URL <http://www.xinyi.gov.cn/zwgk/zcjd/> 中 `http://www.xinyi.gov.cn/` 的字段 `www` 和 `zwgk/zcjd/` 作为路径填入。此时路由为 [`/gov/xinyi/www/zwgk/zcjd/`](https://rsshub.app/gov/xinyi/www/zwgk/zcjd/)
|
||||
|
||||
:::
|
||||
|
||||
</Route>
|
||||
|
||||
### 高州市人民政府
|
||||
|
||||
<Route author="ShuiHuo" example="/gov/gaozhou/www/zwgk/zcjd" path="/gov/gaozhou/:path+" :paramsDesc="['路径,只填写 `www` 默认为 政策解读']">
|
||||
|
||||
::: tip 提示
|
||||
|
||||
路径处填写对应页面 URL 中最前面的部分和域名后的字段。下面是一个例子。
|
||||
|
||||
若订阅 [政策解读](http://www.gaozhou.gov.cn/zcjd/) 则将对应页面 URL <http://www.gaozhou.gov.cn/zcjd/> 中 `http://www.gaozhou.gov.cn/` 的字段 `www` 和 `zcjd/` 作为路径填入。此时路由为 [`/gov/gaozhou/www/zcjd/`](https://rsshub.app/gov/gaozhou/www/zcjd/)
|
||||
|
||||
:::
|
||||
|
||||
</Route>
|
||||
|
||||
### 化州市人民政府
|
||||
|
||||
<Route author="ShuiHuo" example="/gov/huazhou/www/zwgk/zcjd" path="/gov/huazhou/:path+" :paramsDesc="['路径,只填写 `www` 默认为 政策解读']">
|
||||
|
||||
::: tip 提示
|
||||
|
||||
路径处填写对应页面 URL 中最前面的部分和域名后的字段。下面是一个例子。
|
||||
|
||||
若订阅 [政策解读](http://www.huazhou.gov.cn/syzl/zcjd/) 则将对应页面 URL <http://www.huazhou.gov.cn/syzl/zcjd/> 中 `http://www.huazhou.gov.cn/` 的字段 `www` `syzl/zcjd/` 作为路径填入。此时路由为 [`/gov/huazhou/www/syzl/zcjd/`](https://rsshub.app/gov/huazhou/www/syzl/zcjd/)
|
||||
|
||||
:::
|
||||
|
||||
</Route>
|
||||
|
||||
### 广东茂名滨海新区政务网
|
||||
|
||||
<Route author="ShuiHuo" example="/gov/mgs/www/zwgk/zcjd" path="/gov/mgs/:path+" :paramsDesc="['路径,只填写 `www` 默认为 政务公开 > 政策解读']">
|
||||
|
||||
::: tip 提示
|
||||
|
||||
路径处填写对应页面 URL 中最前面的部分和域名后的字段。下面是一个例子。
|
||||
|
||||
若订阅 [政务公开 > 政策解读](http://www.mgs.gov.cn/zwgk/zcjd/) 则将对应页面 URL <http://www.mgs.gov.cn/zwgk/zcjd/> 中 `http://www.mgs.gov.cn/` 的字段 `www` 和 `zwgk/zcjd/` 作为路径填入。此时路由为 [`/gov/mgs/www/zwgk/zcjd/`](https://rsshub.app/gov/mgs/www/zwgk/zcjd/)
|
||||
|
||||
:::
|
||||
|
||||
</Route>
|
||||
|
||||
### 广东茂名高新技术产业开发区
|
||||
|
||||
<Route author="ShuiHuo" example="/gov/mmht/www/xwzx/zcjd" path="/gov/mmht/:path+" :paramsDesc="['路径,只填写 `www` 默认为 政务公开 > 政策解读']">
|
||||
|
||||
::: tip 提示
|
||||
|
||||
路径处填写对应页面 URL 中最前面的部分和域名后的字段。下面是一个例子。
|
||||
|
||||
若订阅 [政务公开 > 政策解读](http://www.mmht.gov.cn/xwzx/zcjd/) 则将对应页面 URL <http://www.mmht.gov.cn/xwzx/zcjd/> 中 `http://www.mmht.gov.cn/` 的字段 `www` 和 `xwzx/zcjd/` 作为路径填入。此时路由为 [`/gov/mmht/www/xwzx/zcjd/`](https://rsshub.app/gov/mmht/www/xwzx/zcjd/)
|
||||
|
||||
:::
|
||||
|
||||
</Route>
|
||||
|
||||
### 广东省茂名水东湾新城建设管理委员会
|
||||
|
||||
<Route author="ShuiHuo" example="/gov/sdb/www/zwgk/zcjd" path="/gov/sdb/:path+" :paramsDesc="['路径,只填写 `www` 默认为 政务公开 > 政策解读']">
|
||||
|
||||
::: tip 提示
|
||||
|
||||
路径处填写对应页面 URL 中最前面的部分和域名后的字段。下面是一个例子。
|
||||
|
||||
若订阅 [政务公开 > 政策解读](http://www.sdb.gov.cn/zwgk/zcjd/) 则将对应页面 URL <http://www.sdb.gov.cn/zwgk/zcjd/> 中 `http://www.sdb.gov.cn/` 的字段 `www` 和 `zwgk/zcjd/` 作为路径填入。此时路由为 [`/gov/sdb/www/zwgk/zcjd/`](https://rsshub.app/gov/sdb/www/zwgk/zcjd/)
|
||||
|
||||
:::
|
||||
|
||||
</Route>
|
||||
|
||||
## 国家广播电视总局
|
||||
|
||||
### 分类
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
const { gdgov } = require('../general/general');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const info = {
|
||||
defaultPath: 'zwgk/zcjd/',
|
||||
list_element: '.news_list li a',
|
||||
title_element: '.content_title',
|
||||
title_match: '(.*)',
|
||||
description_element: '#zoomcon',
|
||||
author_element: undefined,
|
||||
author_match: undefined,
|
||||
authorisme: '茂名市电白区人民政府网',
|
||||
pubDate_element: 'publishtime',
|
||||
pubDate_match: '(.*)',
|
||||
pubDate_format: undefined,
|
||||
};
|
||||
await gdgov(info, ctx);
|
||||
};
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
const { gdgov } = require('../general/general');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const info = {
|
||||
defaultPath: 'zcjd/',
|
||||
list_element: '.newslist li a',
|
||||
list_include: 'site',
|
||||
title_element: '.head',
|
||||
title_match: '(.*)',
|
||||
description_element: '.contener',
|
||||
author_element: undefined,
|
||||
author_match: undefined,
|
||||
authorisme: '高州市人民政府网',
|
||||
pubDate_element: '.time span:nth-child(1)',
|
||||
pubDate_match: '发布时间:(.*)',
|
||||
pubDate_format: undefined,
|
||||
};
|
||||
await gdgov(info, ctx);
|
||||
};
|
||||
|
|
@ -0,0 +1,250 @@
|
|||
// 来人拯救一下啊( >﹏<。)
|
||||
// 待做功能:
|
||||
// 1. 传入和处理
|
||||
// [] index.php?c=category&id=12
|
||||
// 2. 处理其他网站链接
|
||||
// [] 其他政府网站
|
||||
// 3. 添加视频内容
|
||||
// [] 示例1: http://www.dianbai.gov.cn/ywdt/dbyw/content/post_1091433.html
|
||||
// 4. 处理网站功能
|
||||
// [] hdjlpt 互动交流
|
||||
|
||||
// 使用方法
|
||||
// const { gdgov } = require('../general/general');
|
||||
//
|
||||
// module.exports = async (ctx) => {
|
||||
// const info = {
|
||||
// pathstartat: 1, // 网站放到子目录时使用,默认为0。如 www.yunfu.gov.cn/yfsrmzf/jcxxgk/zcfg/zcjd 为一层子目录则使用 1。
|
||||
// defaultPath: 'zwgk/zcjd/', // 默认路径。假设网址是 a.b.gov.cn/c/d/ 则输入 c/d/。访问 gov/b/a/ 时使用默认路径,访问 gov/b/a/c/d/ 则为指定路径。
|
||||
// name_element: 'SiteName, ColumnName', // 网站名,默认使用网页标题。
|
||||
// name_match_type: 'meta', // 网站名类型。可选 meta(从 <meta> 中获取 content 里面的内容)、name(name_element 就是网站名)、element(选择元素从中获取文本)。
|
||||
// name_match: '(.*)', // 网站名类型为 element 时使用的匹配内容。
|
||||
// name_join: '—', // 网站名为 meta 或 element 时,如有多个选择器找到内容,将这里的字符串放到这些内容之间。
|
||||
// list_element: '.news_list li a', // 页面列表中选择具体到 a。element 都是填写 CSS 选择器。
|
||||
// list_include: 'site', // 筛选列表中的页面,会生成选择器添加到 list_element 中。可选 all(包含全部)、site(仅限本站)。
|
||||
// title_element: '.content_title', // 正文的标题,默认使用 <meta name="ArticleTitle" content="*">
|
||||
// title_match: '(.*)', // 使用正则匹配选择器获取到的文本。match 都是填写正则表达式。
|
||||
// description_element: '#zoomcon', // 正文。
|
||||
// author_element: undefined, // 正文来源,一般是某某网站、某某媒体,默认使用 <meta name="ContentSource" content="*">。
|
||||
// author_match: undefined, // 匹配正文来源。
|
||||
// authorisme: '茂名市电白区人民政府网', // 作者是 本网 等内容时改成这里的文本。
|
||||
// pubDate_element: 'publishtime', // 发布时间,默认使用 <meta name="PubDate" content="*">。
|
||||
// pubDate_match: '(.*)', // 匹配发布时间。
|
||||
// pubDate_format: undefined // 发布时间的格式。
|
||||
// };
|
||||
// await gdgov(info, ctx);
|
||||
// };
|
||||
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
const timezone = require('@/utils/timezone');
|
||||
|
||||
const gdgov = async (info, ctx) => {
|
||||
const path = ctx.path.split('/').filter((item) => item !== '');
|
||||
const [site, branch] = path;
|
||||
|
||||
// 网站
|
||||
const pathstartat = info.pathstartat === undefined ? 0 : info.pathstartat;
|
||||
let rootUrl = 'http://' + branch + '.' + site + '.gov.cn';
|
||||
for (let index = 0; index < pathstartat; index++) {
|
||||
const element = path[index + 2];
|
||||
rootUrl = rootUrl + '/' + element;
|
||||
}
|
||||
|
||||
// 默认路径
|
||||
const defaultPath = info.defaultPath;
|
||||
|
||||
// 网站名
|
||||
let name_element = info.name_element;
|
||||
const name_match_type = info.name_match_type;
|
||||
const name_match = info.name_match;
|
||||
const name_join = info.name_join;
|
||||
|
||||
// 列表元素
|
||||
let list_element = info.list_element;
|
||||
let list_include = info.list_include;
|
||||
if (list_element === undefined) {
|
||||
list_element = 'a[href*="content"]';
|
||||
list_include = 'site';
|
||||
}
|
||||
if (list_include === 'site') {
|
||||
list_element = list_element.split(',').filter((item) => item !== '');
|
||||
for (let index = 0; index < list_element.length; index++) {
|
||||
list_element[index] += '[href*="' + rootUrl.slice(7) + '"]';
|
||||
}
|
||||
list_element = list_element.join(',');
|
||||
}
|
||||
|
||||
// 标题元素
|
||||
let title_element = info.title_element;
|
||||
let title_match = info.title_match;
|
||||
|
||||
// 作者(来源)元素
|
||||
const author_element = info.author_element;
|
||||
const author_match = info.author_match;
|
||||
const authorisme = info.authorisme;
|
||||
|
||||
// 正文
|
||||
let description_element = info.description_element;
|
||||
|
||||
// 发布时间元素
|
||||
let pubDate_element = info.pubDate_element;
|
||||
let pubDate_match = info.pubDate_match;
|
||||
let pubDate_format = info.pubDate_format;
|
||||
|
||||
path.splice(0, 2 + pathstartat);
|
||||
let pathname = path.join('/');
|
||||
pathname = pathname === '' ? defaultPath : pathname.endsWith('/') ? pathname : pathname + '/';
|
||||
const currentUrl = `${rootUrl}/${pathname}`;
|
||||
|
||||
let $ = '';
|
||||
let name = '';
|
||||
let list = '';
|
||||
// 判断是否处于特殊目录
|
||||
if (pathname.startsWith('gkmlpt')) {
|
||||
title_element = undefined;
|
||||
title_match = undefined;
|
||||
description_element = 'div[class="article-content"]';
|
||||
pubDate_element = undefined;
|
||||
pubDate_match = undefined;
|
||||
pubDate_format = undefined;
|
||||
|
||||
const res = await got(`${rootUrl}/gkmlpt/api/all/0`);
|
||||
name = authorisme + '政府信息公开平台';
|
||||
list = res.data.articles.filter((item) => item.url.includes('content'));
|
||||
} else {
|
||||
const res = await got(currentUrl);
|
||||
const dataArray = res.data;
|
||||
$ = cheerio.load(dataArray);
|
||||
switch (name_match_type) {
|
||||
case 'name':
|
||||
name = name_element;
|
||||
break;
|
||||
case 'meta':
|
||||
name_element = name_element.split(',').filter((item) => item !== '');
|
||||
for (let index = 0; index < name_element.length; index++) {
|
||||
name_element[index] = $('meta[name="' + name_element[index].trim() + '"]').attr('content');
|
||||
}
|
||||
name = name_element.join(name_join);
|
||||
break;
|
||||
case 'element':
|
||||
name_element = name_element.split(',').filter((item) => item !== '');
|
||||
for (let index = 0; index < name_element.length; index++) {
|
||||
name_element[index] = $(name_element[index].trim()).text().match(name_match)[1];
|
||||
}
|
||||
name = name_element.join(name_join);
|
||||
break;
|
||||
default:
|
||||
name = $('head title').text();
|
||||
break;
|
||||
}
|
||||
list = $(list_element);
|
||||
}
|
||||
|
||||
const lists = Array.from(
|
||||
list.map((i, item) => {
|
||||
let link = '';
|
||||
|
||||
if (pathname.startsWith('gkmlpt')) {
|
||||
link = i.url;
|
||||
} else {
|
||||
link = $(item).attr('href');
|
||||
// 判断获取到的链接是否完整,不完整则补全。
|
||||
if (!link.startsWith('http')) {
|
||||
link.startsWith('/') ? (link = `${rootUrl}${link}`) : (link = `${rootUrl}/${link}`);
|
||||
}
|
||||
}
|
||||
|
||||
return link;
|
||||
})
|
||||
);
|
||||
|
||||
const items = await Promise.all(
|
||||
lists.map((link) => {
|
||||
const idlink = new URL(link);
|
||||
|
||||
if (idlink.pathname === '/zcjdpt') {
|
||||
// http://www.dg.gov.cn/zcjdpt?id=4798
|
||||
// http://smzj.maoming.gov.cn/zcjdpt?id=4595
|
||||
// http://fgj.maoming.gov.cn/zcjdpt?id=4993
|
||||
// https://zcjd.cloud.gd.gov.cn/api/home/article?id=4993
|
||||
return ctx.cache.tryGet(link, async () => {
|
||||
const { art } = require('@/utils/render');
|
||||
|
||||
const zcjdlink = 'https://zcjd.cloud.gd.gov.cn/api/home/article' + idlink.search;
|
||||
const response = await got(zcjdlink);
|
||||
const data = response.data.data;
|
||||
for (let index = 0; index < data.jie_du_items.length; index++) {
|
||||
data.jie_du_items[index].jd_content = data.jie_du_items[index].jd_content.replace(/((\n {4})|(\n))/g, '</p><p style="font-size: 16px;line-height: 32px;text-indent: 2em;">');
|
||||
}
|
||||
|
||||
return {
|
||||
link,
|
||||
title: data.art_title,
|
||||
description: art(__dirname + '/templates/zcjdpt.art', data),
|
||||
pubDate: timezone(parseDate(data.pub_time), +8),
|
||||
author: RegExp('(本|本网|本站)').test(data.pub_unite) ? authorisme : data.pub_unite,
|
||||
};
|
||||
});
|
||||
} else if (idlink.host === 'mp.weixin.qq.com') {
|
||||
const { finishArticleItem } = require('@/utils/wechat-mp');
|
||||
return finishArticleItem(ctx, { link });
|
||||
} else {
|
||||
return ctx.cache.tryGet(link, async () => {
|
||||
// 获取网页
|
||||
const { data: res } = await got(link);
|
||||
const content = cheerio.load(res);
|
||||
|
||||
// 获取来源
|
||||
let author = '';
|
||||
if (author_element === undefined) {
|
||||
author = content('meta[name="ContentSource"]').attr('content');
|
||||
} else {
|
||||
author = content(author_element).text().trim().match(author_match)[1].trim().replace(/(-*$)/g, '');
|
||||
}
|
||||
|
||||
// 获取发布时间
|
||||
let pubDate = '';
|
||||
if (pubDate_element === undefined) {
|
||||
pubDate = content('meta[name="PubDate"]').attr('content');
|
||||
} else {
|
||||
pubDate = content(pubDate_element).text().trim().match(pubDate_match)[1].trim().replace(/(-*$)/g, '');
|
||||
}
|
||||
|
||||
// 获取标题
|
||||
let title = '';
|
||||
if (title_element === undefined) {
|
||||
title = content('meta[name="ArticleTitle"]').attr('content');
|
||||
} else {
|
||||
title = content(title_element).text().trim().match(title_match)[1];
|
||||
}
|
||||
// 获取正文
|
||||
const description_content = description_element.split(',').filter((item) => item !== '');
|
||||
for (let index = 0; index < description_content.length; index++) {
|
||||
description_content[index] = content(description_content[index].trim()).html();
|
||||
}
|
||||
const description = description_content.join('');
|
||||
|
||||
return {
|
||||
link,
|
||||
title,
|
||||
description,
|
||||
pubDate: timezone(parseDate(pubDate, pubDate_format), +8),
|
||||
author: RegExp('(本|本网|本站)').test(author) ? authorisme : author,
|
||||
};
|
||||
});
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
ctx.state.data = {
|
||||
title: name,
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
gdgov,
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,19 @@
|
|||
const { gdgov } = require('../general/general');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const info = {
|
||||
defaultPath: 'syzl/zcjd/',
|
||||
list_element: '.list-content li a',
|
||||
list_include: 'site',
|
||||
title_element: 'h3',
|
||||
title_match: '(.*)',
|
||||
description_element: '.txt',
|
||||
author_element: undefined,
|
||||
author_match: undefined,
|
||||
authorisme: '化州市人民政府网',
|
||||
pubDate_element: '.article-date',
|
||||
pubDate_match: '日期:(.*)',
|
||||
pubDate_format: undefined,
|
||||
};
|
||||
await gdgov(info, ctx);
|
||||
};
|
||||
|
|
@ -45,13 +45,21 @@ module.exports = {
|
|||
'/beijing/bphc/:channel': ['bigfei'],
|
||||
'/beijing/jw/tzgg': ['nczitzk'],
|
||||
'/beijing/kw/:channel': ['Fatpandac'],
|
||||
'/guangdong/tqyb/tfxtq': ['Fatpandac'],
|
||||
'/dianbai/:path+': ['ShuiHuo'],
|
||||
'/gaozhou/:path+': ['ShuiHuo'],
|
||||
'/guangdong/tqyb/sncsyjxh': ['Fatpandac'],
|
||||
'/guangdong/tqyb/tfxtq': ['Fatpandac'],
|
||||
'/gz/xw/:category': ['drgnchan'],
|
||||
'/gz/zwgk/:category': ['drgnchan'],
|
||||
'/hebei/czt/xwdt/:category?': ['nczitzk'],
|
||||
'/huazhou/:path+': ['ShuiHuo'],
|
||||
'/huizhou/zwgk/:category?': ['Fatpandac'],
|
||||
'/hunan/changsha/major-email': ['shansing'],
|
||||
'/maoming/:path+': ['ShuiHuo'],
|
||||
'/maonan/:category': ['ShuiHuo'],
|
||||
'/mgs/:path+': ['ShuiHuo'],
|
||||
'/mmht/:path+': ['ShuiHuo'],
|
||||
'/sdb/:path+': ['ShuiHuo'],
|
||||
'/shaanxi/kjt/:id?': ['nczitzk'],
|
||||
'/shanghai/rsj/ksxm': ['Fatpandac'],
|
||||
'/shanghai/wsjkw/yqtb': ['zcf0508'],
|
||||
|
|
@ -61,5 +69,6 @@ module.exports = {
|
|||
'/shenzhen/zzb/:caty/:page?': ['zlasd'],
|
||||
'/sichuan/deyang/govpulicinfo/:countyName': ['zytomorrow'],
|
||||
'/taiyuan/rsj/:caty/:page?': ['2PoL'],
|
||||
'/xinyi/:path+': ['ShuiHuo'],
|
||||
'/xuzhou/hrss/:category?': ['nczitzk'],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,416 @@
|
|||
const { gdgov } = require('../general/general');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const path = ctx.path.split('/').filter((item) => item !== '');
|
||||
let pathstartat = 0;
|
||||
let defaultPath = '';
|
||||
let list_element = '';
|
||||
let list_include = 'site';
|
||||
let title_element = '';
|
||||
let title_match = '(.*)';
|
||||
let description_element = '';
|
||||
let authorisme = '';
|
||||
let pubDate_element = '';
|
||||
let pubDate_match = '';
|
||||
// let pubDate_format = undefined;
|
||||
switch (path[1]) {
|
||||
case 'www':
|
||||
list_element = '.GsTL5 a';
|
||||
authorisme = '茂名市人民政府网';
|
||||
switch (path[2]) {
|
||||
case undefined:
|
||||
list_element = 'h1 a, #d11_li ul a[href*="content"], .two-o ul a[href*="content"], .thr-o ul a[href*="content"]';
|
||||
break;
|
||||
case 'jtysj':
|
||||
pathstartat = 1;
|
||||
defaultPath = 'gkmlpt/';
|
||||
authorisme = '茂名市交通运输局';
|
||||
break;
|
||||
case 'mmtyjrswj':
|
||||
pathstartat = 1;
|
||||
defaultPath = 'gkmlpt/';
|
||||
authorisme = '茂名市退役军人事务局';
|
||||
break;
|
||||
case 'mmsjj':
|
||||
pathstartat = 1;
|
||||
defaultPath = 'gkmlpt/';
|
||||
authorisme = '茂名市审计局';
|
||||
break;
|
||||
case 'mmgyzc':
|
||||
pathstartat = 1;
|
||||
defaultPath = 'gkmlpt/';
|
||||
authorisme = '茂名市人民政府国有资产监督管理委员会';
|
||||
break;
|
||||
case 'mmtjj':
|
||||
pathstartat = 1;
|
||||
defaultPath = 'gkmlpt/';
|
||||
authorisme = '茂名市统计局';
|
||||
break;
|
||||
case 'mmylbzj':
|
||||
pathstartat = 1;
|
||||
defaultPath = 'gkmlpt/';
|
||||
authorisme = '茂名市医疗保障局';
|
||||
break;
|
||||
case 'mmjrgzj':
|
||||
pathstartat = 1;
|
||||
defaultPath = 'gkmlpt/';
|
||||
authorisme = '茂名市金融工作局';
|
||||
break;
|
||||
case 'xfj':
|
||||
pathstartat = 1;
|
||||
defaultPath = 'gkmlpt/';
|
||||
authorisme = '茂名市信访局';
|
||||
break;
|
||||
case 'mmzfgjj':
|
||||
pathstartat = 1;
|
||||
defaultPath = 'gkmlpt/';
|
||||
authorisme = '茂名市住房公积金管理中心';
|
||||
break;
|
||||
case 'mmgxhzs':
|
||||
pathstartat = 1;
|
||||
defaultPath = 'gkmlpt/';
|
||||
authorisme = '茂名市供销合作联社';
|
||||
break;
|
||||
case 'mmdszbgs':
|
||||
pathstartat = 1;
|
||||
defaultPath = 'gkmlpt/';
|
||||
authorisme = '茂名市地志办';
|
||||
break;
|
||||
case 'mmjjlyslgc':
|
||||
pathstartat = 1;
|
||||
defaultPath = 'gkmlpt/';
|
||||
authorisme = '茂名市高州水库管理中心';
|
||||
break;
|
||||
case 'ywdt':
|
||||
switch (path[3]) {
|
||||
case undefined:
|
||||
list_element = '#d11_li ul a[href*="content"], .two-o ul a[href*="content"]';
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'zwgk':
|
||||
switch (path[3]) {
|
||||
case undefined:
|
||||
list_element = '.er-zw-l ul a';
|
||||
break;
|
||||
case 'zcjd':
|
||||
switch (path[4]) {
|
||||
case undefined:
|
||||
list_element = '.swiper-slide a, .bt a, .zcjdlist a';
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
title_element = '#ScDetailTitle';
|
||||
description_element = '#zoomcon';
|
||||
pubDate_element = '.desc span:nth-child(2)';
|
||||
pubDate_match = '日期:(.*)';
|
||||
break;
|
||||
// 不知道这种怎么做
|
||||
// case 'rd':
|
||||
// defaultPath = 'index.php?c=category&id=12';
|
||||
// list_element = '.news_title ul li \a'';
|
||||
// list_include = 'all';
|
||||
// title_element = '.article_title';
|
||||
// title_match = '(.*)';
|
||||
// description_element = '.article_content > *:not(.article_)';
|
||||
// authorisme = '茂名市人大网';
|
||||
// pubDate_element = '.op_ span:nth-child(1)';
|
||||
// pubDate_match = '发布时间:(.*)';
|
||||
// break;
|
||||
case 'fgj':
|
||||
list_element = '.list a';
|
||||
switch (path[2]) {
|
||||
case undefined:
|
||||
list_element = '.item a, .index-news-list a';
|
||||
break;
|
||||
case 'zwgk':
|
||||
switch (path[3]) {
|
||||
case undefined:
|
||||
list_element = '.zw-news-list a';
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
title_element = '.title';
|
||||
description_element = '.content';
|
||||
authorisme = '茂名市发展和改革局';
|
||||
pubDate_element = '.info';
|
||||
pubDate_match = '发布时间:(.*)';
|
||||
break;
|
||||
case 'jxj':
|
||||
if (path[2] === undefined) {
|
||||
list_element = '.lanse_16, .hei_14, .NoticeInfo li a, #con_two_2 a, #con_two_3 a, .hei[href*="content"], .main2lr_main a';
|
||||
} else {
|
||||
list_element = '#main21l_main_dk > table > tbody > tr > td:nth-child(2) a';
|
||||
}
|
||||
title_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(2)';
|
||||
description_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(4)';
|
||||
authorisme = '茂名市工业和信息化局';
|
||||
pubDate_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(3) > td > table > tbody > tr > td';
|
||||
pubDate_match = '发表时间:\n(.*)';
|
||||
break;
|
||||
case 'mmjyj':
|
||||
list_element = '.news_title a';
|
||||
if (path[3] === undefined) {
|
||||
switch (path[2]) {
|
||||
case undefined:
|
||||
list_element = '.title0_ a, .content0 a';
|
||||
break;
|
||||
case 'xwzx':
|
||||
list_element = '.news_title li a, .news_title_ li a';
|
||||
break;
|
||||
}
|
||||
}
|
||||
title_element = '.article_title';
|
||||
description_element = '.article_body';
|
||||
authorisme = '茂名市教育局';
|
||||
pubDate_element = '.op_ span:nth-child(2)';
|
||||
pubDate_match = '发布时间:(.*)';
|
||||
break;
|
||||
case 'kjj':
|
||||
if (path[2] === undefined) {
|
||||
list_element = '.hover-content-item ul li a[href*="kjj.maoming.gov.cn"][href*="content"]';
|
||||
} else {
|
||||
list_element = '.list-right-content a[href*="kjj.maoming.gov.cn"], .list-right-content a[href*="mp.weixin.qq.com"]';
|
||||
}
|
||||
list_include = 'all';
|
||||
title_element = '.article-detail-title';
|
||||
description_element = '.article-detail-content';
|
||||
authorisme = '茂名市科学技术局';
|
||||
pubDate_element = '.article-detail-time span:nth-child(2)';
|
||||
pubDate_match = '发布时间:(.*)';
|
||||
break;
|
||||
case 'mmga':
|
||||
if (path[3] === undefined) {
|
||||
list_element = '.lnewsc a[href*="content"]';
|
||||
} else {
|
||||
list_element = '.new_list a';
|
||||
}
|
||||
title_element = '.top h2';
|
||||
description_element = '.mid.text';
|
||||
authorisme = '茂名市公安局';
|
||||
pubDate_element = '.top td:nth-child(1)';
|
||||
pubDate_match = '时间:(.*)';
|
||||
break;
|
||||
case 'smzj':
|
||||
defaultPath = 'zwgk/xxgkml/zcjd/';
|
||||
list_element = '.HK_List_ul_5 a';
|
||||
title_element = '.HTitle';
|
||||
description_element = '#mmhygs';
|
||||
authorisme = '茂名市民政局';
|
||||
pubDate_element = '.HTime';
|
||||
pubDate_match = '日期:(.*)';
|
||||
break;
|
||||
case 'sfj':
|
||||
if (path[2] === undefined) {
|
||||
list_element = '.bothA a';
|
||||
} else {
|
||||
list_element = '.list a';
|
||||
}
|
||||
title_element = '.title';
|
||||
description_element = '#context';
|
||||
authorisme = '茂名市司法局';
|
||||
pubDate_element = '.info span:nth-child(1)';
|
||||
pubDate_match = '发布时间:(.*)';
|
||||
break;
|
||||
case 'czj':
|
||||
if (path[2] === undefined) {
|
||||
list_element = '.tabContent_item a[href*="content"]';
|
||||
} else {
|
||||
list_element = '.newsList_right .clearfix a';
|
||||
}
|
||||
title_element = '.newsContainer_title';
|
||||
description_element = '.newsContainer_text';
|
||||
authorisme = '茂名市财政局';
|
||||
pubDate_element = '.time';
|
||||
pubDate_match = '(.*)';
|
||||
break;
|
||||
case 'mmrs':
|
||||
list_element = '.g-list a';
|
||||
if (path[3] === undefined) {
|
||||
switch (path[2]) {
|
||||
case undefined:
|
||||
list_element = '.news-box a, .new_list a, .news-box2 a[href*="content"]';
|
||||
break;
|
||||
case 'xwzx':
|
||||
list_element = '.marqueetop ul li a, .special-clu ul li a, .soc-list ul li a';
|
||||
break;
|
||||
case 'zwxx':
|
||||
list_element = '.marqueetop a, .gud-file ul li a, .dyn-box ul li a, .org-list a';
|
||||
break;
|
||||
}
|
||||
}
|
||||
title_element = '.pre-box h3';
|
||||
description_element = '.pre-box .clearfix';
|
||||
authorisme = '茂名市人力资源和社会保障局网站';
|
||||
pubDate_element = '.pre-box > *:nth-child(3)';
|
||||
pubDate_match = '发布时间:(.*) ';
|
||||
break;
|
||||
case 'zrzyj':
|
||||
list_element = '.ul li a[href*="content"]';
|
||||
title_element = 'header.title h1';
|
||||
description_element = 'article.info';
|
||||
authorisme = '茂名市自然资源局';
|
||||
pubDate_element = 'header.title p span:nth-child(1)';
|
||||
pubDate_match = '日期:(.*)';
|
||||
break;
|
||||
case 'sthjj':
|
||||
if (path[3] === undefined) {
|
||||
list_element = '.item-style1 ul li a[href*="content"], #notice-box ul li a';
|
||||
} else {
|
||||
list_element = '.pull-left';
|
||||
}
|
||||
title_element = '.article_top_l p';
|
||||
title_match = '(.*)\n';
|
||||
description_element = '.txt';
|
||||
authorisme = '茂名市生态环境局';
|
||||
pubDate_element = '.article_top_l > p > :nth-child(2)';
|
||||
pubDate_match = '发布时间:(.*)';
|
||||
break;
|
||||
case 'jianshe':
|
||||
defaultPath = 'xwdt/zcjd/';
|
||||
list_element = '.listhref a';
|
||||
title_element = '#showtitlediv';
|
||||
description_element = '.aleft > *:nth-child(3)';
|
||||
authorisme = '茂名市住房和城乡建设局';
|
||||
pubDate_element = '#showtitlediv + table';
|
||||
pubDate_match = '刊登时间:(.*),信息';
|
||||
break;
|
||||
case 'swj':
|
||||
defaultPath = 'zcjd/';
|
||||
list_element = '#lblListInfo a';
|
||||
title_element = '.HTitle';
|
||||
description_element = '#mmhygs';
|
||||
authorisme = '茂名市水务局';
|
||||
pubDate_element = '.HTime';
|
||||
pubDate_match = '日期:(.*)';
|
||||
break;
|
||||
case 'mmny':
|
||||
list_element = '.xw > a';
|
||||
switch (path[2]) {
|
||||
case undefined:
|
||||
list_element = '.txt li a, .Tabcon ul li a';
|
||||
break;
|
||||
case 'zsq':
|
||||
if (path[3] !== undefined) {
|
||||
list_element = '.img a';
|
||||
}
|
||||
break;
|
||||
}
|
||||
title_element = '.bt';
|
||||
title_match = '(.*)\n';
|
||||
description_element = '.lien > table > tbody > tr:nth-child(4)';
|
||||
authorisme = '茂名市农业农村局';
|
||||
pubDate_element = '.lien > table > tbody > tr:nth-child(2)';
|
||||
pubDate_match = '日期:(.*) 点击数';
|
||||
break;
|
||||
case 'lyj':
|
||||
if (path[2] === undefined) {
|
||||
list_element = '#main-slide .changeDiv a, .lycneter_all a[href*="content"]';
|
||||
} else {
|
||||
list_element = '.r_text a';
|
||||
}
|
||||
title_element = 'h3';
|
||||
description_element = '.time_r + div';
|
||||
authorisme = '茂名市林业局';
|
||||
pubDate_element = '.time_r';
|
||||
pubDate_match = '发布时间:(.*) 文章来源';
|
||||
break;
|
||||
case 'mmswj':
|
||||
if (path[2] === undefined) {
|
||||
list_element = 'div[id^="con_three_"] a, .pt6 a[href*="content"]';
|
||||
} else {
|
||||
list_element = '#main21l_main_dk > table a';
|
||||
}
|
||||
title_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(2)';
|
||||
description_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(4)';
|
||||
authorisme = '茂名市商务局';
|
||||
pubDate_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(3)';
|
||||
pubDate_match = '发表时间:(.*)';
|
||||
break;
|
||||
case 'wgxj':
|
||||
defaultPath = 'zcfg/zcjd/';
|
||||
list_element = '.com-news a';
|
||||
title_element = '.text-title h2';
|
||||
description_element = '.text-body';
|
||||
authorisme = '茂名市文化广电旅游体育局';
|
||||
pubDate_element = '.text-title p';
|
||||
pubDate_match = '最后更新: (.*) 来源';
|
||||
break;
|
||||
case 'wsjkj':
|
||||
if (path[2] === undefined) {
|
||||
list_element = '.tbv_mn a';
|
||||
} else {
|
||||
list_element = '.news_list a';
|
||||
}
|
||||
title_element = 'h1.content_title';
|
||||
description_element = '#zoomcon';
|
||||
authorisme = '茂名市卫生健康局';
|
||||
pubDate_element = '.desc span:nth-child(1)';
|
||||
pubDate_match = '发布时间:(.*)';
|
||||
break;
|
||||
case 'scj':
|
||||
if (path[2] === undefined) {
|
||||
list_element = '.title_content a';
|
||||
} else {
|
||||
list_element = '.news_list > ul > li a';
|
||||
}
|
||||
title_element = '.subject_tit';
|
||||
description_element = '#zoomcon';
|
||||
authorisme = '茂名市市场监督管理局';
|
||||
pubDate_element = '.subject_litle span:nth-child(1)';
|
||||
pubDate_match = '发布时间:(.*)';
|
||||
break;
|
||||
case 'ajj':
|
||||
if (path[2] === undefined) {
|
||||
list_element = '.picList a, .title_content a[href*="content"]';
|
||||
} else {
|
||||
list_element = '.newslist ul li a';
|
||||
}
|
||||
title_element = '.opinion_result center p:nth-child(1)';
|
||||
description_element = '.opinion_result_content';
|
||||
authorisme = '茂名市应急管理局';
|
||||
pubDate_element = '.opinion_result center p:nth-child(2) span:nth-child(1)';
|
||||
pubDate_match = '发布时间:(.*)';
|
||||
break;
|
||||
case 'cgj':
|
||||
if (path[2] === undefined) {
|
||||
list_element = '#con_two_1 a[href*="cgj.maoming.gov.cn"], #con_two_1 a[href*="mp.weixin.qq.com"], .newshotkuan.pt9 .heibti[href*="cgj.maoming.gov.cn"], .newshotkuan.pt9 .heibti[href*="mp.weixin.qq.com"], .qkuan01.mt9 .heibti[href*="cgj.maoming.gov.cn"], .qkuan01.mt9 .heibti[href*="mp.weixin.qq.com"], #demo a[href*="cgj.maoming.gov.cn"], #demo a[href*="mp.weixin.qq.com"], .main3lr_main a[href*="cgj.maoming.gov.cn"], .main3lr_main a[href*="mp.weixin.qq.com"]';
|
||||
} else {
|
||||
list_element = '#main21l_main_dkc .hei[href*="cgj.maoming.gov.cn"], #main21l_main_dkc .hei[href*="mp.weixin.qq.com"]';
|
||||
}
|
||||
list_include = 'all';
|
||||
title_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(2)';
|
||||
description_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(4)';
|
||||
authorisme = '茂名市城市管理和综合执法局';
|
||||
pubDate_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(3)';
|
||||
pubDate_match = '发表时间:(.*)';
|
||||
break;
|
||||
case 'xzfw':
|
||||
defaultPath = 'zcjd/';
|
||||
list_element = '#lblListInfo a';
|
||||
title_element = '.HTitle';
|
||||
description_element = '#mmhygs';
|
||||
authorisme = '茂名市政务服务网';
|
||||
pubDate_element = '.HTime';
|
||||
pubDate_match = '发布日期:(.*) 点击率';
|
||||
break;
|
||||
}
|
||||
const info = {
|
||||
pathstartat,
|
||||
defaultPath,
|
||||
list_element,
|
||||
list_include,
|
||||
title_element,
|
||||
title_match,
|
||||
description_element,
|
||||
authorisme,
|
||||
pubDate_element,
|
||||
pubDate_match,
|
||||
// pubDate_format,
|
||||
};
|
||||
await gdgov(info, ctx);
|
||||
};
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
const timezone = require('@/utils/timezone');
|
||||
|
||||
const host = 'http://www.maonan.gov.cn';
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
let id = '';
|
||||
let name = '';
|
||||
|
||||
switch (ctx.params.category) {
|
||||
case 'zwgk':
|
||||
id = 'zwgk';
|
||||
name = '政务公开';
|
||||
break;
|
||||
case 'zwxw':
|
||||
id = 'zwxw';
|
||||
name = '政务新闻';
|
||||
break;
|
||||
case 'mndt':
|
||||
id = 'zwxw/mndt';
|
||||
name = '茂南动态';
|
||||
break;
|
||||
case 'zdhy':
|
||||
id = 'zwxw/zdhy';
|
||||
name = '重大会议';
|
||||
break;
|
||||
case 'tzgg':
|
||||
id = 'zwgk/tzgg';
|
||||
name = '公告公示';
|
||||
break;
|
||||
case 'zlxx':
|
||||
id = 'zwgk/zlxx';
|
||||
name = '招录信息';
|
||||
break;
|
||||
case 'zcjd':
|
||||
id = 'zwgk/zcjd';
|
||||
name = '政策解读';
|
||||
break;
|
||||
}
|
||||
|
||||
const res = await got(`${host}/${id}/`);
|
||||
const dataArray = res.data;
|
||||
const $ = cheerio.load(dataArray);
|
||||
const list = $('li.clearfix a[href*="www.maonan.gov.cn"], li.clearfix a[href*="mp.weixin.qq.com"]');
|
||||
|
||||
const items = await Promise.all(
|
||||
list.map((i, item) => {
|
||||
item = $(item);
|
||||
|
||||
const url = new URL(item.attr('href'));
|
||||
const link = url.href;
|
||||
|
||||
const pubDate = timezone(parseDate($('a[href="' + link + '"] ~ .time').text()), +8);
|
||||
|
||||
return ctx.cache.tryGet(link, async () => {
|
||||
// 获取网页
|
||||
const { data: res } = await got(link);
|
||||
const content = cheerio.load(res);
|
||||
|
||||
switch (url.host) {
|
||||
case 'mp.weixin.qq.com':
|
||||
return {
|
||||
title: item.text(),
|
||||
description: content('#js_content').html(),
|
||||
pubDate,
|
||||
link,
|
||||
author: content('#js_name').text(),
|
||||
};
|
||||
case 'www.maonan.gov.cn':
|
||||
switch (url.pathname) {
|
||||
case '/zcjdpt':
|
||||
return {
|
||||
title: content('meta[name="ArticleTitle"]').attr('content'),
|
||||
description: content('.wrap').html(),
|
||||
pubDate,
|
||||
link,
|
||||
author: content('meta[name="ContentSource"]').attr('content') === '本网' ? '茂名市茂南区人民政府网' : content('meta[name="ContentSource"]').attr('content'),
|
||||
};
|
||||
default:
|
||||
return {
|
||||
title: content('.newsContainer_title').text(),
|
||||
description: content('.newsContainer_text').html(),
|
||||
pubDate,
|
||||
link,
|
||||
author: content('.author').text().trim() === '本网' ? '茂名市茂南区人民政府网' : content('.author').text().trim(),
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
);
|
||||
|
||||
ctx.state.data = {
|
||||
title: `茂名市茂南区人民政府 - ${name}`,
|
||||
link: `${host}/${id}`,
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
const { gdgov } = require('../general/general');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const info = {
|
||||
defaultPath: 'zwgk/zcjd/',
|
||||
list_element: '.list_con li a',
|
||||
list_include: 'site',
|
||||
title_element: '.title',
|
||||
title_match: '(.*)',
|
||||
description_element: '.artile_con',
|
||||
author_element: undefined,
|
||||
author_match: undefined,
|
||||
authorisme: '广东茂名滨海新区政务网',
|
||||
pubDate_element: '.note > span:nth-child(1)',
|
||||
pubDate_match: '时间:(.*)',
|
||||
pubDate_format: undefined,
|
||||
};
|
||||
await gdgov(info, ctx);
|
||||
};
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
const { gdgov } = require('../general/general');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const info = {
|
||||
defaultPath: 'xwzx/zcjd/',
|
||||
list_element: '#main21l_main_dk > table > tbody > tr > td:nth-child(2) a',
|
||||
list_include: 'site',
|
||||
title_element: 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(2)',
|
||||
title_match: '(.*)',
|
||||
description_element: 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(4)',
|
||||
author_element: undefined,
|
||||
author_match: undefined,
|
||||
authorisme: '茂名市高新技术产业开发局政务网',
|
||||
pubDate_element: 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(3) > td > table > tbody > tr > td',
|
||||
pubDate_match: '发表时间:(.*) 信息来源',
|
||||
pubDate_format: undefined,
|
||||
};
|
||||
await gdgov(info, ctx);
|
||||
};
|
||||
|
|
@ -428,6 +428,28 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
'dianbai.gov.cn': {
|
||||
_name: '茂名市电白区人民政府',
|
||||
www: [
|
||||
{
|
||||
title: '茂名市电白区人民政府',
|
||||
docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-dian-bai-qu-ren-min-zheng-fu',
|
||||
source: ['/*'],
|
||||
target: (params, url) => `/gov/dianbai/${new URL(url).host.split('.dianbai.gov.cn')[0] + new URL(url).pathname.replace(/(index.*$)/g, '')}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
'gaozhou.gov.cn': {
|
||||
_name: '高州市人民政府',
|
||||
www: [
|
||||
{
|
||||
title: '高州市人民政府',
|
||||
docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-gao-zhou-shi-ren-min-zheng-fu',
|
||||
source: ['/*'],
|
||||
target: (params, url) => `/gov/gaozhou/${new URL(url).host.split('.gaozhou.gov.cn')[0] + new URL(url).pathname.replace(/(index.*$)/g, '')}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
'gz.gov.cn': {
|
||||
_name: '广州市人民政府',
|
||||
www: [
|
||||
|
|
@ -485,6 +507,17 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
'huazhou.gov.cn': {
|
||||
_name: '化州市人民政府',
|
||||
www: [
|
||||
{
|
||||
title: '化州市人民政府',
|
||||
docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-hua-zhou-shi-ren-min-zheng-fu',
|
||||
source: ['/*'],
|
||||
target: (params, url) => `/gov/huazhou/${new URL(url).host.split('.huazhou.gov.cn')[0] + new URL(url).pathname.replace(/(index.*$)/g, '')}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
'huizhou.gov.cn': {
|
||||
_name: '惠州市人民政府',
|
||||
www: [
|
||||
|
|
@ -520,6 +553,64 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
'maoming.gov.cn': {
|
||||
_name: '茂名市人民政府门户网站',
|
||||
'.': [
|
||||
{
|
||||
title: '茂名市人民政府',
|
||||
docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-ren-min-zheng-fu-men-hu-wang-zhan',
|
||||
source: ['/*'],
|
||||
target: (params, url) => `/gov/maoming/${new URL(url).host.split('.maoming.gov.cn')[0] + new URL(url).pathname.replace(/(index.*$)/g, '')}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
'maonan.gov.cn': {
|
||||
_name: '茂名市茂南区人民政府',
|
||||
'.': [
|
||||
{
|
||||
title: '政务公开',
|
||||
docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-mao-nan-qu-ren-min-zheng-fu',
|
||||
source: ['/zwgk/*'],
|
||||
target: '/gov/maonan/zwgk',
|
||||
},
|
||||
{
|
||||
title: '政务新闻',
|
||||
docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-mao-nan-qu-ren-min-zheng-fu',
|
||||
source: ['/zwxw/*'],
|
||||
target: '/gov/maonan/zwxw',
|
||||
},
|
||||
{
|
||||
title: '茂南动态',
|
||||
docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-mao-nan-qu-ren-min-zheng-fu',
|
||||
source: ['/zwxw/mndt/*'],
|
||||
target: '/gov/maonan/mndt',
|
||||
},
|
||||
{
|
||||
title: '重大会议',
|
||||
docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-mao-nan-qu-ren-min-zheng-fu',
|
||||
source: ['/zwxw/zdhy/*'],
|
||||
target: '/gov/maonan/zdhy',
|
||||
},
|
||||
{
|
||||
title: '公告公示',
|
||||
docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-mao-nan-qu-ren-min-zheng-fu',
|
||||
source: ['/zwgk/tzgg/*'],
|
||||
target: '/gov/maonan/tzgg',
|
||||
},
|
||||
{
|
||||
title: '招录信息',
|
||||
docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-mao-nan-qu-ren-min-zheng-fu',
|
||||
source: ['/zwgk/zlxx/*'],
|
||||
target: '/gov/maonan/zlxx',
|
||||
},
|
||||
{
|
||||
title: '政策解读',
|
||||
docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-mao-nan-qu-ren-min-zheng-fu',
|
||||
source: ['/zwgk/zcjd/*'],
|
||||
target: '/gov/maonan/zcjd',
|
||||
},
|
||||
],
|
||||
},
|
||||
'mee.gov.cn': {
|
||||
_name: '生态环境部',
|
||||
www: [
|
||||
|
|
@ -542,6 +633,17 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
'mgs.gov.cn': {
|
||||
_name: '广东茂名滨海新区政务网',
|
||||
www: [
|
||||
{
|
||||
title: '广东茂名滨海新区政务网',
|
||||
docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-guang-dong-mao-ming-bin-hai-xin-qu-zheng-wu-wang',
|
||||
source: ['/*'],
|
||||
target: (params, url) => `/gov/mgs/${new URL(url).host.split('.mgs.gov.cn')[0] + new URL(url).pathname.replace(/(index.*$)/g, '')}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
'miit.gov.cn': {
|
||||
_name: '工业和信息化部',
|
||||
'.': [
|
||||
|
|
@ -559,6 +661,17 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
'mmht.gov.cn': {
|
||||
_name: '广东茂名高新技术产业开发区',
|
||||
www: [
|
||||
{
|
||||
title: '茂名高新技术产业开发区政务网',
|
||||
docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-guang-dong-mao-ming-gao-xin-ji-shu-chan-ye-kai-fa-qu',
|
||||
source: ['/*'],
|
||||
target: (params, url) => `/gov/mmht/${new URL(url).host.split('.mmht.gov.cn')[0] + new URL(url).pathname.replace(/(index.*$)/g, '')}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
'moe.gov.cn': {
|
||||
_name: '中华人民共和国教育部',
|
||||
'.': [
|
||||
|
|
@ -705,6 +818,17 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
'sdb.gov.cn': {
|
||||
_name: '广东省茂名水东湾新城建设管理委员会',
|
||||
www: [
|
||||
{
|
||||
title: '广东省茂名水东湾新城建设管理委员会',
|
||||
docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-guang-dong-sheng-mao-ming-shui-dong-wan-xin-cheng-jian-she-guan-li-wei-yuan-hui',
|
||||
source: ['/*'],
|
||||
target: (params, url) => `/gov/sdb/${new URL(url).host.split('.sdb.gov.cn')[0] + new URL(url).pathname.replace(/(index.*$)/g, '')}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
'sh.gov.cn': {
|
||||
_name: '上海市人民政府',
|
||||
wsjkw: [
|
||||
|
|
@ -809,6 +933,17 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
'xinyi.gov.cn': {
|
||||
_name: '信宜市人民政府',
|
||||
www: [
|
||||
{
|
||||
title: '信宜市人民政府',
|
||||
docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-xin-yi-shi-ren-min-zheng-fu',
|
||||
source: ['/*'],
|
||||
target: (params, url) => `/gov/xinyi/${new URL(url).host.split('.xinyi.gov.cn')[0] + new URL(url).pathname.replace(/(index.*$)/g, '')}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
'www.gov.cn': {
|
||||
_name: '中国政府网',
|
||||
'.': [
|
||||
|
|
|
|||
|
|
@ -37,12 +37,20 @@ module.exports = function (router) {
|
|||
router.get(/beijing\/bphc(\/[\w/-]+)?/, require('./beijing/bphc'));
|
||||
router.get('/beijing/jw/tzgg', require('./beijing/jw/tzgg'));
|
||||
router.get('/beijing/kw/:channel', require('./beijing/kw/index'));
|
||||
router.get('/guangdong/tqyb/tfxtq', require('./guangdong/tqyb/tfxtq'));
|
||||
router.get(/dianbai(\/[\w/-]+)?/, require('./dianbai/dianbai'));
|
||||
router.get(/gaozhou(\/[\w/-]+)?/, require('./gaozhou/gaozhou'));
|
||||
router.get('/guangdong/tqyb/sncsyjxh', require('./guangdong/tqyb/sncsyjxh'));
|
||||
router.get('/guangdong/tqyb/tfxtq', require('./guangdong/tqyb/tfxtq'));
|
||||
router.get('/gz/:channel/:category', require('./gz/index'));
|
||||
router.get('/hebei/czt/xwdt/:category?', require('./hebei/czt'));
|
||||
router.get(/huazhou(\/[\w/-]+)?/, require('./huazhou/huazhou'));
|
||||
router.get('/huizhou/zwgk/:category?', require('./huizhou/zwgk/index'));
|
||||
router.get('/hunan/changsha/major-email', require('./hunan/changsha/major-email'));
|
||||
router.get(/maoming(\/[\w/-]+)?/, require('./maoming/maoming'));
|
||||
router.get('/maonan/:category', require('./maonan/maonan'));
|
||||
router.get(/mgs(\/[\w/-]+)?/, require('./mgs/mgs'));
|
||||
router.get(/mmht(\/[\w/-]+)?/, require('./mmht/mmht'));
|
||||
router.get(/sdb(\/[\w/-]+)?/, require('./sdb/sdb'));
|
||||
router.get('/shaanxi/kjt/:id?', require('./shaanxi/kjt'));
|
||||
router.get('/shanghai/rsj/ksxm', require('./shanghai/rsj/ksxm'));
|
||||
router.get('/shanghai/wsjkw/yqtb', require('./shanghai/wsjkw/yqtb'));
|
||||
|
|
@ -52,5 +60,6 @@ module.exports = function (router) {
|
|||
router.get('/shenzhen/zzb/:caty/:page?', require('./shenzhen/zzb/index'));
|
||||
router.get('/sichuan/deyang/govpulicinfo/:countyName', require('./sichuan/deyang/govpulicinfo'));
|
||||
router.get('/taiyuan/rsj/:caty/:page?', require('./taiyuan/rsj'));
|
||||
router.get(/xinyi(\/[\w/-]+)?/, require('./xinyi/xinyi'));
|
||||
router.get('/xuzhou/hrss/:category?', require('./xuzhou/hrss'));
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
const { gdgov } = require('../general/general');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const info = {
|
||||
defaultPath: 'zwgk/zcjd/',
|
||||
list_element: '.art-list li a',
|
||||
list_include: 'site',
|
||||
title_element: '.title',
|
||||
title_match: '(.*)',
|
||||
description_element: '.text',
|
||||
author_element: '.source',
|
||||
author_match: '来源:(.*)发布时间',
|
||||
authorisme: '广东省茂名水东湾新城建设管理委员会网站',
|
||||
pubDate_element: '.source',
|
||||
pubDate_match: '发布时间:(.*)',
|
||||
pubDate_format: undefined,
|
||||
};
|
||||
await gdgov(info, ctx);
|
||||
};
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
const { gdgov } = require('../general/general');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const info = {
|
||||
defaultPath: 'zwgk/zcjd/',
|
||||
list_element: '.newsList li a',
|
||||
list_include: 'site',
|
||||
title_element: '.title',
|
||||
title_match: '(.*)',
|
||||
description_element: '.conTxt',
|
||||
author_element: undefined,
|
||||
author_match: undefined,
|
||||
authorisme: '信宜市人民政府网',
|
||||
pubDate_element: '.property span:nth-child(-n+2)',
|
||||
pubDate_match: '发布时间:(.*)',
|
||||
pubDate_format: undefined,
|
||||
};
|
||||
await gdgov(info, ctx);
|
||||
};
|
||||
Loading…
Reference in New Issue