RSSHub/lib
Alex 2ca1b3afa5
feat(route): add Wikipedia current events (#20100)
* feat(route): add Wikipedia current events

Add RSS feed for Wikipedia Portal:Current events providing the past 7 days of current events. Parses MediaWiki templates and converts wiki markup to HTML.

- Hierarchical bullet point structures with nested <ul>/<li> tags
- Proper paragraph breaks between sections
- Correct nesting depth for multi-level lists
- Clean separation of content sections

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor(route/wikipedia): break down complex wikiToHtml function

- Split 123-line wikiToHtml function into 6 smaller, focused methods
- Each function now has a single responsibility (links, formatting, lists, etc.)
- Improved code readability and maintainability
- End-to-end tested: route produces identical RSS output with proper HTML formatting

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(route/wikipedia): use config.trueUA instead of hardcoded User-Agent

Replace hardcoded User-Agent string with config.trueUA to follow
project conventions for HTTP requests.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(route/wikipedia): use config.cache.contentExpire for cache duration

Replace hardcoded 6-hour cache duration with configurable contentExpire
setting to follow project caching conventions.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat(route/wikipedia): implement efficient current events RSS with single API request

- Switch from web scraping to MediaWiki API for better reliability
- Implement single batch API request with continuation support for multiple pages
- Add current-day inclusion parameter with time-based logic (auto/always/never/hour)
- Add proper error handling and ESLint compliance

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor(route/wikipedia): consolidate list processing and add API documentation

- Move wrapListItems and processNestedLists calls inside (renamed) processListsAndLines to eliminate non-obvious coupling
- Remove newlines from processNestedLists output for more compact HTML
- Add documentation about Wikipedia API endpoints and query options

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-21 22:12:30 +08:00
..
api
assets feat(icon): add RSSHub icon in SVG format (#19887) 2025-08-22 21:28:13 +08:00
errors fix(tests): update expected values and increase timeout for Puppeteer tests 2025-08-22 17:45:39 +08:00
middleware feat(route/telegram): Fix tglib (#18268) 2025-09-16 21:41:05 +08:00
routes feat(route): add Wikipedia current events (#20100) 2025-09-21 22:12:30 +08:00
routes-deprecated
utils chore(deps-dev): bump eslint-plugin-unicorn from 60.0.0 to 61.0.2 (#19998) 2025-09-08 23:03:48 +08:00
views chore(deps-dev): bump eslint-plugin-unicorn from 60.0.0 to 61.0.2 (#19998) 2025-09-08 23:03:48 +08:00
app-bootstrap.tsx
app.test.ts
app.ts
config.test.ts
config.ts feat(route)!: qweather api host change (#20042) 2025-09-12 18:37:16 +08:00
index.ts
pkg.test.ts
pkg.ts
registry.test.ts
registry.ts feat(route/telegram): Fix tglib (#18268) 2025-09-16 21:41:05 +08:00
router.js
routes.test.ts
server.ts fix(vercel): sync export default hono app (#19989) 2025-09-08 05:28:46 +08:00
setup.test.ts
types.ts feat(route/telegram): Fix tglib (#18268) 2025-09-16 21:41:05 +08:00