RSSHub/lib
lucky13820 8d8a435a48
fix(route/theinitium): rewrite for Ghost CMS after site migration (#21071)
* refactor(theinitium): rewrite routes for Ghost CMS, add cookie support

- Rewrite all routes to use Ghost Content API (old API deprecated)
- Add INITIUM_MEMBER_COOKIE env var for paid article full-text
- Add features block with requireConfig to all route files
- Add url field and radar rules per RSSHub standards
- Strip -zh-hans suffix from author/category display names
- Update namespace with English name and zh translations
- Mark follow route as deprecated (Ghost doesn't support it)
- Fix hostname binding to 0.0.0.0 for LAN access

* fix(theinitium): use routeExpire with refresh=false to prevent stale cache

Cache was never expiring because refresh=true (default) extends TTL on every hit.
Now uses 5-min routeExpire and won't extend on access.

* refactor(theinitium): address review feedback

- Remove unused INITIUM_USERNAME/PASSWORD/BEARER_TOKEN env keys
- Remove hardcoded User-Agent (use RSSHub's internal UA)
- Remove fragile html.length > 500 check
- Remove refresh: false from cache.tryGet
- Hoist stripLangSuffix to module scope (dedupe with cleanName)

* fix(theinitium): detect paywall CTA instead of length check

If cookie is invalid/expired, scrape returns paywall HTML.
Check for .gh-post-upgrade-cta to detect this and fall back
to cleaner Ghost API preview.

* revert(index): restore '::' hostname per #16513

* feat(theinitium): clean Ghost Koenig card HTML for RSS output

* fix(theinitium): use redirected Ghost API URL, remove unused config types

* fix(theinitium): remove unrelated neureality config changes

---------

Co-authored-by: Ryan Yao <ryanyao@Macmini.lan>
Co-authored-by: Ryan Yao <ryanyao@Ryans-Mac-mini.lan>
Co-authored-by: Ryan Yao <ryanyao@Ryans-Mac-mini.local>
2026-03-09 04:13:25 +08:00
..
api feat(api): add cache probing (#21300) 2026-03-05 02:36:53 +08:00
assets
errors
middleware style: update oxlint to use simple-import-sort 2026-03-04 03:13:57 +08:00
routes fix(route/theinitium): rewrite for Ghost CMS after site migration (#21071) 2026-03-09 04:13:25 +08:00
routes-deprecated fix: quanta magazine (#21031) 2026-02-03 02:13:39 +08:00
shims style: migrate eslint to oxlint (#21224) 2026-02-28 21:23:11 +08:00
utils feat(api): add cache probing (#21300) 2026-03-05 02:36:53 +08:00
views
app-bootstrap.test.tsx
app-bootstrap.tsx
app.test.ts
app.ts
app.worker.tsx chore: replace postlight/parser with jocmp/mercury-parser (#21152) 2026-02-15 01:27:25 +08:00
config.remote-error.test.ts
config.test.ts
config.ts fix(route/theinitium): rewrite for Ghost CMS after site migration (#21071) 2026-03-09 04:13:25 +08:00
container.ts feat: add Cloudflare Containers deployment support (#20932) 2026-01-20 15:29:13 +08:00
entrypoints.test.ts
index.test.ts
index.ts
pkg.test.ts
pkg.ts
registry.dynamic.test.ts
registry.test.ts
registry.ts fix(lib/registry.ts): Allow hide debug info. (#20891) 2026-01-15 19:33:36 +08:00
route-paths.d.ts
router.js fix(route/javbus): remove avgle api usage (#20861) 2026-01-13 00:38:10 +08:00
routes.test.ts
server.ts
setup.test.ts style: migrate eslint to oxlint (#21224) 2026-02-28 21:23:11 +08:00
types.ts
worker.ts
worker.worker.test.ts test: double worker test timeout 2026-01-09 23:12:27 +08:00