Commit Graph
5 Commits
Author SHA1 Message Date
uuwor 6dd5106441 feat(route): A new routing (cdrw.ts) has been created (#18786)
* 为jwgg.ts添加了部分注释;新建了路由tzggcdunews.ts

* Update jwgg.ts

Indentation has been added after the comments '//' or '/*'

* Update tzggcdunews.ts

Indentation has been added after the comments '//' or '/*'

* Update jwgg.ts

Adjusted Code format

* Update jwgg.ts

完整的 URL:在 url 字段中添加了协议部分(https://)。
选择器修正:直接在 title 中查找 <a> 标签而不是 tr.odd a,这减少了选择器的复杂度。
日期匹配检查:加入了对 dateMatch 的检查,以防止运行时错误。
使用模板字符串:在构建 link 时使用模板字符串,使代码更易读。
过滤无发布日期的项目:在返回结果时,过滤掉那些没有发布日期的项,以确保输出的数据质量。

* 重写tzggcdunews.ts;还原jwgg.ts

* Update lib/routes/cdu/tzggcdunews.ts

* Create news.ts

成大新闻

* Update news.ts

主要修复点
列表项选择器修正:

原代码使用$('a[title]')选择器不够精确

改为使用$('ul.ul-mzw-litpic-a2 li a.con')更精确地定位新闻条目

日期解析改进:

保持原有的两种日期格式处理逻辑

确保日期解析正确并转换为UTC+8时区

链接处理:

正确处理相对路径链接,使用new URL(link, rootUrl).href构建完整URL

标题提取:

从.tit元素中提取标题,而不是依赖title属性

详情页内容提取:

使用.v_news_content选择器获取正文内容

移除页脚等无关元素

RSS标题生成:

从页面标题和分类标题组合生成更有意义的RSS标题

错误处理:

添加了适当的错误处理逻辑,确保在元素不存在时不会报错

* Update news.ts

路由索引

* Create cdrw.ts

增添成大人物订阅

* Delete lib/routes/cdu/news.ts

DELETE NEWS.TS
2025-04-08 01:13:46 +08:00
uuwor 994abe131b feat(route): A new routing (tzggcdunews.ts) for https://news.cdu.edu.cn/tzgg.htm has been created (#18713)
* 为jwgg.ts添加了部分注释;新建了路由tzggcdunews.ts

* Update jwgg.ts

Indentation has been added after the comments '//' or '/*'

* Update tzggcdunews.ts

Indentation has been added after the comments '//' or '/*'

* Update jwgg.ts

Adjusted Code format

* Update jwgg.ts

完整的 URL:在 url 字段中添加了协议部分(https://)。
选择器修正:直接在 title 中查找 <a> 标签而不是 tr.odd a,这减少了选择器的复杂度。
日期匹配检查:加入了对 dateMatch 的检查,以防止运行时错误。
使用模板字符串:在构建 link 时使用模板字符串,使代码更易读。
过滤无发布日期的项目:在返回结果时,过滤掉那些没有发布日期的项,以确保输出的数据质量。

* 重写tzggcdunews.ts;还原jwgg.ts

* Update lib/routes/cdu/tzggcdunews.ts

---------
2025-03-29 01:46:50 +08:00
pseudoyu 0a42f88de7 feat(route): add lang field in route namespace 2024-11-01 22:09:31 +07:00
github-actions[bot] 26993f9ebf style: auto format 2024-08-29 18:04:39 +00:00
uuworandTony e884dc438f feat(route): add route for https://jw.cdu.edu.cn/ (#16548)
* feat(route): add route for https://jw.cdu.edu.cn/

添加了成都大学教务处公告通知

* Update jwgg.ts

gwgg-->jwgg

* Update jwgg.ts

https://jw.cdu.edu.cn/jwgg.html-->https://jw.cdu.edu.cn/jwgg.htm

* Delete lib/cdu directory

incorrect directory place

* Add files via upload

add cdu

* Add files via upload

fix:
Enforce consistent linebreak style
Error
Expected linebreaks to be 'LF' but found 'CRLF'.

* Add files via upload

fix namespace.ts's
Error
Expected linebreaks to be 'LF' but found 'CRLF'.

* Add files via upload

correct some errors

* Add files via upload

修复了不匹配问题

* Update jwgg.ts

////-->/**/

* Update jwgg.ts

Enforce consistent spacing after the `//` or `/*` in a comment
one tab

* Update jwgg.ts

A space has been added after /*

* Add files via upload

description repair try

* Update jwgg.ts

A space has been added after /*

* Update lib/routes/cdu/jwgg.ts

update maintainers

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* Update jwgg.ts

/**/ was used instead of ////

* Update lib/routes/cdu/namespace.ts

---------
2024-08-30 02:02:48 +08:00