Skip to content

feat(jisilu): add timeline and question adapters for jisilu.cn#139

Open
yetingsky wants to merge 1 commit intojackwener:mainfrom
yetingsky:feat/jisilu-adapter
Open

feat(jisilu): add timeline and question adapters for jisilu.cn#139
yetingsky wants to merge 1 commit intojackwener:mainfrom
yetingsky:feat/jisilu-adapter

Conversation

@yetingsky
Copy link

Summary

  • Add jisilu timeline command to fetch personal timeline from jisilu.cn (requires login)
  • Add jisilu question command to fetch post content and comments from jisilu.cn

Features

timeline

  • Fetches personal timeline from /home/mine/#all
  • Shows post id, type (post/reply), title, author, content preview, and url
  • Supports --limit parameter

question

  • Fetches post content and all comments
  • Shows author, content, and time for each reply
  • Supports --limit parameter to limit number of comments
  • Accepts both post ID or full URL

Usage

# Get personal timeline
opencli jisilu timeline --limit 20

# Get post details
opencli jisilu question --id 519605
opencli jisilu question --id https://www.jisilu.cn/question/519605 --limit 100

Testing

Both commands have been tested successfully with various limit values.

Copy link
Contributor

@Astro-Han Astro-Han left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition for the jisilu community! A few things to address:

Code style — double quotes

The project's biome config requires single quotes. Both files use double quotes throughout, which will likely be caught by CI or pre-commit hooks.

question.tsid should be positional

Per CONTRIBUTING.md, main target args (id, url, query) should use positional: true. opencli jisilu question 519605 is more natural than --id 519605.

question.ts — missing return value guard

return data on line 79 has no Array.isArray check. If evaluate returns null (page not found, JS error), the output formatter will crash. Other adapters use return Array.isArray(data) ? data : [].

timeline.ts — missing navigateBefore: false

With Strategy.COOKIE + domain, the framework auto-navigates to www.jisilu.cn before func runs, then func navigates again to /home/mine/#all — double navigation wasting 2-3s.

likes column — hardcoded to 0

Both post and replies always show likes: 0. If the data isn't available on the page, consider removing the column rather than showing misleading zeros.

Tests & docs

No E2E tests or documentation updates (README, docs/adapters/, SKILL.md). Per TESTING.md, question (PUBLIC) → browser-public.test.ts, timeline (COOKIE) → browser-auth.test.ts.

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.

2 participants