RSSHub/lib/routes/supercell
fishyo a8b004eb64
feat(route): add supercell game blog routes (#20545)
* feat(route): add supercell game blog routes

- Add support for 5 supercell games (Clash Royale, Brawl Stars, Clash of Clans, Boom Beach, Hay Day)
- Support 12 languages (en, zh, zh-hans, fr, de, id, it, ja, ko, pt, ru, es)
- Extract blog posts from __NEXT_DATA__ JSON
- Cache full article content with fallback to summary

* feat: add Supercell game blog route

* fix(supercell): use regex to extract __NEXT_DATA__ JSON, remove cheerio dependency

* fix(supercell): use bodyCollection to render content, fix namespace capitalization

* fix: improve supercell blog route to extract full content from bodyCollection

- Implement renderRichText and renderNodeContent functions to properly parse rich text JSON format
- Handle both TextBlock and FeatureBlock types from bodyCollection
- Support text formatting marks (bold, italic, underline, code)
- Add proper type annotations to handler function and variables
- Use Next.js JSON endpoint instead of HTML parsing for better performance
- Add error handling with fallback to description if full content extraction fails

* feat(supercell): add ImageBlock and CarouselBlock support for multi-game content extraction

* fix(supercell): use else-if chain and for-of loop for block handling

* refactor(supercell): extract renderBlock function to reduce complexity

* fix(supercell): use switch statement for block type handling
2025-12-04 23:59:51 +08:00
..
blog.ts
namespace.ts