* fix(radio-canada): Repair description fetching after site update
The previous method for fetching the item description broke due to a change in the target website's format.
This commit resolves the issue by extracting the description directly from the main HTML content of the article page. This restores functionality to the feed and provides a more robust parsing method.
* refactor(radio-canada): Parse article content from internal JSON state
This change refactors the content fetching logic to parse a JSON object (`window._rcState_`) from the page. This approach allows for the full reconstruction of the article, including the header image, primer text, and all body attachments (images), by replacing placeholders in the HTML with the correct media.
* fix(radio-canada): Improve content parsing with fallback mechanism
Adds a fallback to the previous HTML scraping method in case the JSON state object is not found. This ensures greater resilience against site changes and improves the chances of successfully retrieving content.
* refactor(radio-canada): Extract content parsing logic into a helper function
To address a "Complex Method" warning from CodeFactor, the logic for parsing the article description from the JSON state has been extracted into a dedicated `parseDescriptionFromState` function.
This change improves code readability and maintainability by simplifying the main handler and isolating the content parsing logic. The `if/else` block was also converted to a ternary operator for conciseness.
* fix(radio-canada): Update image URL parsing to remove width placeholder for header and body attachments
---------
* feat(route): secretsanfrancisco.com
* style: auto format
* chore: use feed link to fetch list
* refactor: use wp api to fetch content
* chore: rename section to category
* feat: caption
* chore: cr
* chore: cache first category
* fix(route): verge parse error
* style: auto format
* chore: cr
* fix: ImageSliderBlockType
* style: auto format
* fix: unsupport type
* style: auto format
* fix: unsupport type
* Update lib/routes/theverge/index.ts
Co-authored-by: Tony <TonyRL@users.noreply.github.com>
* chore: cr
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: yifan.wang1004 <yifan.wang1004@bytedance.com>
- Added a rate limiter for subtitle requests to prevent exceeding API limits.
- Integrated subtitle fetching into the ranking and weekly recommendation routes, allowing for optional subtitle attachments based on configuration.
- Updated item mapping to include subtitles when available.
* feat(zaobao): replace art template with hono jsx
* fix(lint): find funciton reference
* refactor(zaobao): remove ctx parameter from parseList calls in handlers
* fix: hk version
* fix: rework interactive-graphics
* fix: sg version
* fix: update pubDate type to Date in parseList return type
* fix: update host to origin in parseList for correct URL fetching
---------
Co-authored-by: lawrence <lijie@yofish.com>
* refactor: update blog route to improve article extraction logic
* Update lib/routes/cline/blog.ts
Co-authored-by: Tony <TonyRL@users.noreply.github.com>
* Update lib/routes/cline/blog.ts
Co-authored-by: Tony <TonyRL@users.noreply.github.com>
* refactor: simplify article extraction logic in blog route
* refactor: optimize date and author extraction regex in blog route
* fix: update article title extraction in blog route
---------
* fix(routes/eventernote): increase page only once per iteration
* fix(routes/eventernote): fix type errors
* feat(routes/eventernote): add one more page for radar
* fix(route/eventernote): refactor event fetching to use ofetch
---------
* feat(route): secretsanfrancisco.com
* style: auto format
* chore: use feed link to fetch list
* refactor: use wp api to fetch content
* chore: rename section to category
* feat: caption
* chore: cr
* chore: cache first category
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: yifan.wang1004 <yifan.wang1004@bytedance.com>
* feat(routes): Support fetching by different publication cycle and flitering by votes for Huggingfce papers.
* feat(routes): add comment links
* fix(routes): string concatenation style & remove upvotes info from description
* fix(routes): remove comments
- Adjusted expected values in error handling tests to reflect updated application behavior.
- Increased timeout for Puppeteer tests from 20 seconds to 45 seconds to accommodate longer loading times.
- Enhanced the getUser function to check for captcha presence by waiting for the #red-captcha selector.
- Introduced CaptchaError to throw a specific error message when captcha is detected, improving error handling for users.