Skip to content

feat(linux-do): add linux.do adapter with 6 commands#56

Merged
jackwener merged 1 commit intojackwener:mainfrom
Astro-Han:worktree-linux-do-adapter
Mar 18, 2026
Merged

feat(linux-do): add linux.do adapter with 6 commands#56
jackwener merged 1 commit intojackwener:mainfrom
Astro-Han:worktree-linux-do-adapter

Conversation

@Astro-Han
Copy link
Contributor

Summary

Closes #43. Adds linux.do (Discourse-based Chinese tech forum) support with 6 YAML pipeline commands:

  • hot - trending topics with period filter (all/daily/weekly/monthly/yearly)
  • latest - newest topics
  • categories - list all categories (with slug/id for category command)
  • category - browse topics within a specific category
  • topic - post details with replies (first page)
  • search - search topics by keyword

All commands use navigate + evaluate pattern with cookie auth (browser: true), since linux.do enforces login_required on all API endpoints.

Security

  • User string inputs (keyword, slug, period) sanitized via | json template filter + encodeURIComponent
  • Integer inputs (id, limit) type-enforced by framework before template expansion

HTML handling (topic command)

  • Block tags (<p>, <br>, <div>, etc.) converted to spaces
  • Named entities (&amp;, &lt;, etc.) decoded
  • Numeric entities (decimal &#39; and hex &#x27;) decoded via String.fromCodePoint with try-catch guard
  • Content truncated to 200 chars

Files changed

  • src/clis/linux-do/ - 6 YAML adapter files
  • tests/e2e/browser-auth.test.ts - 6 graceful-failure test cases

Test plan

  • npm run build - 110 entries (30 YAML, 80 TS), includes 6 new linux-do commands
  • npm run typecheck - passes
  • npx vitest run src/ - 200 unit tests pass
  • opencli linux-do --help - all 6 subcommands registered
  • 4 rounds of multi-model code review (crosscheck)
  • Live data verification (requires linux.do login - invite-only registration)

Add linux.do (Discourse-based forum) support with 6 YAML pipeline commands:
- hot: trending topics with period filter (all/daily/weekly/monthly/yearly)
- latest: newest topics
- categories: list all categories with slug/id for further queries
- category: browse topics within a specific category
- topic: post details with replies (first page)
- search: search topics by keyword

All commands use navigate+evaluate pattern with cookie auth
(linux.do enforces login_required on all endpoints).

Security: user inputs sanitized via | json filter + encodeURIComponent.
HTML content stripped with block-tag spacing and full entity decoding.
@jackwener jackwener merged commit e1d4a6e into jackwener:main Mar 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Support linux.do platform

2 participants