Harvie 51ef0df0c2 feat(route): add 国际能源网 (in-en.com) news route (#21669)
* feat(route): add 国际能源网 (in-en.com) news route

Add RSS route for in-en.com (国际能源网), a major Chinese energy news portal.

Supported channels via /in-en/news/:type:
- solar  — 光伏太阳能
- wind   — 风电
- chuneng — 储能
- h2     — 氢能
- chd    — 充换电
- newenergy — 新能源综合
- power  — 电力
- huanbao — 环保

Features: fetches article list from each subdomain's news page,
then retrieves full article body via detail page (cached).
Handles Chinese relative timestamps (X分钟/小时/天前).

* fix(in-en): add maintainer, fix timezone double-shift, translate comments to English

* fix(in-en): correct news paths for h2/chd/huanbao, drop date-only pubDate override

* fix(in-en): sort imports, fix numeric separators, add category field, use trueUA

* fix(in-en): address review comments

- Remove config.trueUA, use default UA
- Remove custom parseRelTime, use parseDate directly
- Fix title text extraction without cloning element
- Remove unnecessary .first() on pubDate
- Fix author: handle both em.ly and plain-text source via .prompt > span
- Simplify category field (remove redundant length check)
- Fix description selector: .article-body → #article
- Fix detail author selector: .article-meta .source a → p.source a
- Remove try-catch around detail fetch

* fix(in-en): fix author including category text and handle relative pubDate formats

* fix(in-en): use parseRelativeDate, simplify selectors, drop redundant fallbacks

- Replace hand-rolled relative-date logic with parseRelativeDate (covers
  "刚刚 / N分钟前 / N小时前 / 今天 HH:MM / 昨天 HH:MM / YYYY-MM-DD"). Fixes
  Invalid Date on the first few entries and resolves the two oxlint findings
  (no-useless-undefined, numeric-separators-style).
- Drop the `.first()` on `.listTxt .prompt i` — each `ul.infoList > li` carries
  exactly one `<i>` (date), confirmed against https://solar.in-en.com/news/.
- Author selector: `.prompt > span:first-of-type`, then strip leading "来源:".
  Cheerio's `.text()` flattens `<em class="ly">…</em>` into the same string,
  so this matches both shapes shown on https://solar.in-en.com/news/
  (plain text vs. wrapped in em.ly).
- Category selector: `.prompt > span:not(:first-of-type) em a`, scoped to the
  second span so author text never leaks in.
- Drop `|| undefined` on author and `?? ''` on description (redundant —
  DataItem already accepts undefined).
- Add an HTML-shape comment pointing to the live sample URL so future
  reviewers can verify the layout assumptions.

* fix(in-en): drop dead default + use new-media category

- Hono treats `:type` as compulsory (path is `/news/:type`), so users without
  it never reach the handler — the `?? 'solar'` fallback was unreachable.
  Replace with a non-null assertion to keep the type narrow.
- categories: 'traditional-media' → 'new-media' per review suggestion.
2026-05-07 11:20:00 +08:00
2026-01-13 00:06:06 +08:00
2018-04-11 01:48:11 +08:00
2025-12-07 00:15:41 +08:00
2026-01-13 00:06:06 +08:00
2025-11-27 14:32:29 +08:00
2025-06-06 21:38:15 +08:00
2025-12-28 18:42:39 +08:00
2026-03-17 16:00:00 +08:00
2024-03-09 20:30:59 +08:00
2024-03-03 17:36:08 +08:00
2026-03-25 23:16:40 +08:00

RSSHub

RSSHub

🧡 Everything is RSSible

docker publish npm publish test Test coverage Visitors

Telegram group Telegram channel X (Twitter)

Introduction

RSSHub is the world's largest RSS network, consisting of over 5,000 global instances.

RSSHub delivers millions of contents aggregated from all kinds of sources, our vibrant open source community is ensuring the deliver of RSSHub's new routes, new features and bug fixes.

RSSHub pairs especially well with Folo, an AI RSS reader for feed discovery and modern reading workflows. The project is also open source on GitHub.

Documentation | Folo | Telegram Group | Telegram Channel | X (Twitter)

  • Folo | An AI RSS reader that works especially well with RSSHub. Source code: GitHub.
  • RSSHub Radar | A browser extension that can help you quickly discover and subscribe to the RSS and RSSHub of current websites.
  • RSSBud | RSSHub Radar for iOS platform, designed specifically for mobile ecosystem optimization.
  • RSSAid | RSSHub Radar for Android platform built with Flutter.
  • DocSearch | Link RSSHub DocSearch into Raycast.
  • Awesome RSSHub Routes | Curated list of RSS feeds and RSSHub routes.

Contribute

We welcome all pull requests. Suggestions and feedback are also welcomed here.

Refer to Quick Start

Deployment

Refer to Deployment

Special Thanks

Logo designer sheldonrrr

              

Author

RSSHub © DIYgod, Released under the AGPL-3.0 License.
Authored and maintained by DIYgod with help from contributors (list).

Blog @DIYgod · GitHub @DIYgod · X (Twitter) @DIYgod · Telegram Channel @awesomeDIYgod

Languages
TypeScript 99.6%
JavaScript 0.3%