publishport-opencli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +214 -0
- package/README.md +299 -0
- package/README.zh-CN.md +341 -0
- package/cli-manifest.json +51513 -0
- package/clis/12306/auth.js +25 -0
- package/clis/12306/me.js +9 -0
- package/clis/12306/orders.js +13 -0
- package/clis/12306/passengers.js +14 -0
- package/clis/12306/price.js +1 -0
- package/clis/12306/stations.js +1 -0
- package/clis/12306/train.js +1 -0
- package/clis/12306/trains.js +1 -0
- package/clis/12306/utils.js +1 -0
- package/clis/1688/assets.js +127 -0
- package/clis/1688/auth.js +1 -0
- package/clis/1688/download.js +1 -0
- package/clis/1688/item.js +21 -0
- package/clis/1688/search.js +129 -0
- package/clis/1688/shared.js +11 -0
- package/clis/1688/store.js +26 -0
- package/clis/1point3acres/auth.js +18 -0
- package/clis/1point3acres/digest.js +1 -0
- package/clis/1point3acres/forum.js +1 -0
- package/clis/1point3acres/forums.js +1 -0
- package/clis/1point3acres/hot.js +1 -0
- package/clis/1point3acres/latest.js +1 -0
- package/clis/1point3acres/notifications.js +1 -0
- package/clis/1point3acres/search.js +1 -0
- package/clis/1point3acres/thread.js +2 -0
- package/clis/1point3acres/user.js +1 -0
- package/clis/1point3acres/utils.js +6 -0
- package/clis/36kr/article.js +20 -0
- package/clis/36kr/hot.js +16 -0
- package/clis/36kr/news.js +1 -0
- package/clis/36kr/search.js +36 -0
- package/clis/51job/company.js +36 -0
- package/clis/51job/detail.js +35 -0
- package/clis/51job/hot.js +1 -0
- package/clis/51job/search.js +1 -0
- package/clis/51job/utils.js +21 -0
- package/clis/_atlassian/shared.js +21 -0
- package/clis/_shared/article/auth.js +16 -0
- package/clis/_shared/article/douban-md2draft.js +4 -0
- package/clis/_shared/article/format.js +1 -0
- package/clis/_shared/article/images.js +95 -0
- package/clis/_shared/article/login.js +1 -0
- package/clis/_shared/article/page-runtime.js +745 -0
- package/clis/_shared/article/publish.js +34 -0
- package/clis/_shared/common.js +1 -0
- package/clis/_shared/content-guard.js +1 -0
- package/clis/_shared/desktop-commands.js +1 -0
- package/clis/_shared/search-adapter.js +1 -0
- package/clis/_shared/site-auth.js +1 -0
- package/clis/_shared/token-auth.js +2 -0
- package/clis/_shared/video-publish.js +62 -0
- package/clis/aibase/news.js +31 -0
- package/clis/amazon/auth.js +19 -0
- package/clis/amazon/bestsellers.js +1 -0
- package/clis/amazon/discussion.js +20 -0
- package/clis/amazon/movers-shakers.js +1 -0
- package/clis/amazon/new-releases.js +1 -0
- package/clis/amazon/offer.js +29 -0
- package/clis/amazon/product.js +25 -0
- package/clis/amazon/rankings.js +68 -0
- package/clis/amazon/search.js +16 -0
- package/clis/amazon/shared.js +11 -0
- package/clis/antigravity/SKILL.md +38 -0
- package/clis/antigravity/_actions.js +201 -0
- package/clis/antigravity/audit-extras.js +78 -0
- package/clis/antigravity/delete.js +1 -0
- package/clis/antigravity/dump.js +1 -0
- package/clis/antigravity/extract-code.js +18 -0
- package/clis/antigravity/history.js +1 -0
- package/clis/antigravity/mark-read.js +1 -0
- package/clis/antigravity/model.js +90 -0
- package/clis/antigravity/new.js +9 -0
- package/clis/antigravity/read.js +10 -0
- package/clis/antigravity/rename.js +1 -0
- package/clis/antigravity/send.js +11 -0
- package/clis/antigravity/serve.js +97 -0
- package/clis/antigravity/status.js +1 -0
- package/clis/antigravity/storage.js +12 -0
- package/clis/antigravity/watch.js +6 -0
- package/clis/apple-podcasts/episodes.js +1 -0
- package/clis/apple-podcasts/search.js +1 -0
- package/clis/apple-podcasts/top.js +1 -0
- package/clis/apple-podcasts/utils.js +1 -0
- package/clis/archive/item.js +1 -0
- package/clis/archive/search.js +1 -0
- package/clis/archive/snapshots.js +1 -0
- package/clis/archive/wayback.js +1 -0
- package/clis/arxiv/author.js +1 -0
- package/clis/arxiv/paper.js +1 -0
- package/clis/arxiv/recent.js +1 -0
- package/clis/arxiv/search.js +1 -0
- package/clis/arxiv/utils.js +1 -0
- package/clis/autohome/__fixtures__/catalog.html +11 -0
- package/clis/autohome/__fixtures__/koubei.json +116 -0
- package/clis/autohome/brand.js +1 -0
- package/clis/autohome/score.js +1 -0
- package/clis/autohome/utils.js +1 -0
- package/clis/baidu-scholar/search.js +63 -0
- package/clis/baijiahao/article.js +1 -0
- package/clis/baijiahao/lists.js +1 -0
- package/clis/baijiahao/login.js +1 -0
- package/clis/baijiahao/publish.js +57 -0
- package/clis/baijiahao/stats.js +1 -0
- package/clis/baijiahao/whoami.js +1 -0
- package/clis/band/auth.js +29 -0
- package/clis/band/bands.js +37 -0
- package/clis/band/mentions.js +6 -0
- package/clis/band/post.js +76 -0
- package/clis/band/posts.js +50 -0
- package/clis/barchart/flow.js +70 -0
- package/clis/barchart/greeks.js +88 -0
- package/clis/barchart/options.js +61 -0
- package/clis/barchart/quote.js +87 -0
- package/clis/bbc/news.js +1 -0
- package/clis/bbc/topic.js +1 -0
- package/clis/bbc/utils.js +1 -0
- package/clis/bilibili/article.js +1 -0
- package/clis/bilibili/auth.js +1 -0
- package/clis/bilibili/categories.js +1 -0
- package/clis/bilibili/coin.js +1 -0
- package/clis/bilibili/comment-del.js +1 -0
- package/clis/bilibili/comment-like.js +1 -0
- package/clis/bilibili/comment.js +1 -0
- package/clis/bilibili/comments.js +1 -0
- package/clis/bilibili/dm-list.js +1 -0
- package/clis/bilibili/dm-read.js +1 -0
- package/clis/bilibili/dm-send.js +1 -0
- package/clis/bilibili/download.js +7 -0
- package/clis/bilibili/drafts.js +1 -0
- package/clis/bilibili/dynamic-post.js +24 -0
- package/clis/bilibili/dynamic.js +1 -0
- package/clis/bilibili/favorite-add.js +1 -0
- package/clis/bilibili/favorite.js +1 -0
- package/clis/bilibili/feed.js +2 -0
- package/clis/bilibili/follow.js +1 -0
- package/clis/bilibili/following.js +1 -0
- package/clis/bilibili/history.js +1 -0
- package/clis/bilibili/hot.js +15 -0
- package/clis/bilibili/like.js +1 -0
- package/clis/bilibili/me.js +1 -0
- package/clis/bilibili/partitions.js +1 -0
- package/clis/bilibili/ranking.js +1 -0
- package/clis/bilibili/search.js +1 -0
- package/clis/bilibili/stats.js +1 -0
- package/clis/bilibili/subtitle.js +21 -0
- package/clis/bilibili/summary.js +1 -0
- package/clis/bilibili/topics.js +1 -0
- package/clis/bilibili/unfollow.js +1 -0
- package/clis/bilibili/upload.js +1 -0
- package/clis/bilibili/user-videos.js +1 -0
- package/clis/bilibili/utils.js +50 -0
- package/clis/bilibili/video-drafts.js +1 -0
- package/clis/bilibili/video.js +1 -0
- package/clis/binance/asks.js +1 -0
- package/clis/binance/depth.js +1 -0
- package/clis/binance/gainers.js +1 -0
- package/clis/binance/klines.js +1 -0
- package/clis/binance/losers.js +1 -0
- package/clis/binance/pairs.js +1 -0
- package/clis/binance/price.js +1 -0
- package/clis/binance/prices.js +1 -0
- package/clis/binance/ticker.js +1 -0
- package/clis/binance/top.js +1 -0
- package/clis/binance/trades.js +1 -0
- package/clis/bloomberg/businessweek.js +12 -0
- package/clis/bloomberg/crypto.js +1 -0
- package/clis/bloomberg/economics.js +1 -0
- package/clis/bloomberg/feeds.js +1 -0
- package/clis/bloomberg/green.js +1 -0
- package/clis/bloomberg/industries.js +1 -0
- package/clis/bloomberg/main.js +1 -0
- package/clis/bloomberg/markets.js +1 -0
- package/clis/bloomberg/news.js +57 -0
- package/clis/bloomberg/opinions.js +1 -0
- package/clis/bloomberg/politics.js +1 -0
- package/clis/bloomberg/pursuits.js +1 -0
- package/clis/bloomberg/tech.js +1 -0
- package/clis/bloomberg/utils.js +17 -0
- package/clis/bluesky/post.js +1 -0
- package/clis/bluesky/shared.js +56 -0
- package/clis/bluesky/whoami.js +1 -0
- package/clis/booking/search.js +93 -0
- package/clis/boss/auth.js +13 -0
- package/clis/boss/batchgreet.js +1 -0
- package/clis/boss/chatlist.js +1 -0
- package/clis/boss/chatmsg.js +1 -0
- package/clis/boss/detail.js +1 -0
- package/clis/boss/exchange.js +1 -0
- package/clis/boss/greet.js +1 -0
- package/clis/boss/invite.js +4 -0
- package/clis/boss/joblist.js +1 -0
- package/clis/boss/mark.js +1 -0
- package/clis/boss/recommend.js +1 -0
- package/clis/boss/resume.js +90 -0
- package/clis/boss/search.js +1 -0
- package/clis/boss/send.js +1 -0
- package/clis/boss/stats.js +1 -0
- package/clis/boss/utils.js +161 -0
- package/clis/brave/search.js +23 -0
- package/clis/chaoxing/assignments.js +1 -0
- package/clis/chaoxing/auth.js +21 -0
- package/clis/chaoxing/exams.js +1 -0
- package/clis/chaoxing/utils.js +58 -0
- package/clis/chatgpt/ask.js +1 -0
- package/clis/chatgpt/auth.js +17 -0
- package/clis/chatgpt/detail.js +1 -0
- package/clis/chatgpt/history.js +1 -0
- package/clis/chatgpt/image.js +1 -0
- package/clis/chatgpt/model.js +1 -0
- package/clis/chatgpt/new.js +1 -0
- package/clis/chatgpt/project-file-add.js +1 -0
- package/clis/chatgpt/project-list.js +1 -0
- package/clis/chatgpt/read.js +1 -0
- package/clis/chatgpt/send.js +1 -0
- package/clis/chatgpt/status.js +1 -0
- package/clis/chatgpt/utils.js +1092 -0
- package/clis/chatgpt-app/ask.js +1 -0
- package/clis/chatgpt-app/ax.js +512 -0
- package/clis/chatgpt-app/model.js +1 -0
- package/clis/chatgpt-app/new.js +1 -0
- package/clis/chatgpt-app/read.js +1 -0
- package/clis/chatgpt-app/send.js +1 -0
- package/clis/chatgpt-app/status.js +1 -0
- package/clis/chatwise/ask.js +1 -0
- package/clis/chatwise/export.js +21 -0
- package/clis/chatwise/history.js +26 -0
- package/clis/chatwise/model.js +48 -0
- package/clis/chatwise/new.js +1 -0
- package/clis/chatwise/read.js +25 -0
- package/clis/chatwise/screenshot.js +1 -0
- package/clis/chatwise/send.js +1 -0
- package/clis/chatwise/status.js +1 -0
- package/clis/chatwise/utils.js +75 -0
- package/clis/chess/analyze.js +1 -0
- package/clis/chess/game.js +1 -0
- package/clis/chess/games.js +1 -0
- package/clis/chess/stats.js +1 -0
- package/clis/chess/utils.js +1 -0
- package/clis/claude/ask.js +4 -0
- package/clis/claude/auth.js +19 -0
- package/clis/claude/detail.js +1 -0
- package/clis/claude/history.js +1 -0
- package/clis/claude/new.js +1 -0
- package/clis/claude/read.js +1 -0
- package/clis/claude/send.js +1 -0
- package/clis/claude/status.js +1 -0
- package/clis/claude/utils.js +179 -0
- package/clis/cnblogs/article.js +1 -0
- package/clis/cnblogs/login.js +1 -0
- package/clis/cnblogs/stats.js +37 -0
- package/clis/cnblogs/whoami.js +1 -0
- package/clis/cnki/search.js +38 -0
- package/clis/codex/_actions.js +72 -0
- package/clis/codex/archive.js +1 -0
- package/clis/codex/ask.js +23 -0
- package/clis/codex/dump.js +1 -0
- package/clis/codex/export.js +12 -0
- package/clis/codex/extract-diff.js +28 -0
- package/clis/codex/history.js +1 -0
- package/clis/codex/model.js +118 -0
- package/clis/codex/new.js +1 -0
- package/clis/codex/pin.js +1 -0
- package/clis/codex/projects.js +1 -0
- package/clis/codex/read.js +16 -0
- package/clis/codex/rename.js +34 -0
- package/clis/codex/screenshot.js +1 -0
- package/clis/codex/send.js +16 -0
- package/clis/codex/sidebar.js +1 -0
- package/clis/codex/status.js +1 -0
- package/clis/coingecko/categories.js +1 -0
- package/clis/coingecko/coin.js +1 -0
- package/clis/coingecko/derivatives.js +1 -0
- package/clis/coingecko/exchanges.js +1 -0
- package/clis/coingecko/global.js +1 -0
- package/clis/coingecko/top.js +1 -0
- package/clis/coingecko/trending.js +1 -0
- package/clis/confluence/create.js +1 -0
- package/clis/confluence/page.js +1 -0
- package/clis/confluence/search.js +1 -0
- package/clis/confluence/shared.js +1 -0
- package/clis/confluence/update.js +1 -0
- package/clis/coupang/add-to-cart.js +86 -0
- package/clis/coupang/auth.js +16 -0
- package/clis/coupang/product.js +161 -0
- package/clis/coupang/search.js +385 -0
- package/clis/coupang/utils.js +1 -0
- package/clis/crates/crate.js +1 -0
- package/clis/crates/search.js +1 -0
- package/clis/crates/utils.js +1 -0
- package/clis/csdn/article.js +29 -0
- package/clis/csdn/columns.js +1 -0
- package/clis/csdn/login.js +1 -0
- package/clis/csdn/stats.js +71 -0
- package/clis/csdn/whoami.js +1 -0
- package/clis/cto51/article.js +1 -0
- package/clis/cto51/whoami.js +1 -0
- package/clis/ctrip/auth.js +1 -0
- package/clis/ctrip/flight.js +17 -0
- package/clis/ctrip/hotel-search.js +24 -0
- package/clis/ctrip/hotel-suggest.js +1 -0
- package/clis/ctrip/search.js +1 -0
- package/clis/ctrip/utils.js +119 -0
- package/clis/cursor/ask.js +22 -0
- package/clis/cursor/composer.js +12 -0
- package/clis/cursor/dump.js +1 -0
- package/clis/cursor/export.js +23 -0
- package/clis/cursor/extract-code.js +18 -0
- package/clis/cursor/history.js +26 -0
- package/clis/cursor/model.js +18 -0
- package/clis/cursor/new.js +1 -0
- package/clis/cursor/read.js +27 -0
- package/clis/cursor/screenshot.js +1 -0
- package/clis/cursor/send.js +12 -0
- package/clis/cursor/status.js +1 -0
- package/clis/dblp/author.js +1 -0
- package/clis/dblp/paper.js +1 -0
- package/clis/dblp/search.js +1 -0
- package/clis/dblp/utils.js +1 -0
- package/clis/dblp/venue.js +1 -0
- package/clis/deepseek/ask.js +1 -0
- package/clis/deepseek/auth.js +22 -0
- package/clis/deepseek/detail.js +1 -0
- package/clis/deepseek/history.js +1 -0
- package/clis/deepseek/new.js +1 -0
- package/clis/deepseek/read.js +1 -0
- package/clis/deepseek/send.js +50 -0
- package/clis/deepseek/status.js +1 -0
- package/clis/deepseek/utils.js +202 -0
- package/clis/defillama/protocol.js +1 -0
- package/clis/defillama/protocols.js +1 -0
- package/clis/defillama/utils.js +1 -0
- package/clis/devto/auth.js +9 -0
- package/clis/devto/latest.js +1 -0
- package/clis/devto/publish.js +17 -0
- package/clis/devto/read.js +3 -0
- package/clis/devto/stats.js +27 -0
- package/clis/devto/tag.js +1 -0
- package/clis/devto/top.js +1 -0
- package/clis/devto/user.js +1 -0
- package/clis/dianping/__fixtures__/search.html +168 -0
- package/clis/dianping/__fixtures__/shop.html +6 -0
- package/clis/dianping/auth.js +10 -0
- package/clis/dianping/cityResolver.js +4 -0
- package/clis/dianping/search.js +1 -0
- package/clis/dianping/shop.js +1 -0
- package/clis/dianping/utils.js +1 -0
- package/clis/dictionary/examples.js +1 -0
- package/clis/dictionary/search.js +1 -0
- package/clis/dictionary/synonyms.js +1 -0
- package/clis/discord-app/channels.js +1 -0
- package/clis/discord-app/delete.js +66 -0
- package/clis/discord-app/goto.js +1 -0
- package/clis/discord-app/members.js +21 -0
- package/clis/discord-app/read.js +1 -0
- package/clis/discord-app/search.js +29 -0
- package/clis/discord-app/send.js +10 -0
- package/clis/discord-app/servers.js +1 -0
- package/clis/discord-app/status.js +1 -0
- package/clis/discord-app/thread-read.js +1 -0
- package/clis/discord-app/threads.js +1 -0
- package/clis/discord-app/utils.js +226 -0
- package/clis/discord-web/auth.js +10 -0
- package/clis/discord-web/send.js +13 -0
- package/clis/dockerhub/image.js +1 -0
- package/clis/dockerhub/search.js +1 -0
- package/clis/dockerhub/utils.js +1 -0
- package/clis/dongchedi/__fixtures__/search.json +60 -0
- package/clis/dongchedi/__fixtures__/series-detail.json +911 -0
- package/clis/dongchedi/__fixtures__/series-score.json +1396 -0
- package/clis/dongchedi/koubei.js +1 -0
- package/clis/dongchedi/models.js +1 -0
- package/clis/dongchedi/score.js +1 -0
- package/clis/dongchedi/search.js +1 -0
- package/clis/dongchedi/series.js +1 -0
- package/clis/dongchedi/specs.js +1 -0
- package/clis/dongchedi/utils.js +1 -0
- package/clis/douban/article.js +53 -0
- package/clis/douban/auth.js +21 -0
- package/clis/douban/book-hot.js +1 -0
- package/clis/douban/download.js +1 -0
- package/clis/douban/marks.js +59 -0
- package/clis/douban/movie-hot.js +1 -0
- package/clis/douban/photos.js +1 -0
- package/clis/douban/reviews.js +53 -0
- package/clis/douban/search.js +1 -0
- package/clis/douban/subject.js +1 -0
- package/clis/douban/top250.js +50 -0
- package/clis/douban/utils.js +344 -0
- package/clis/doubao/ask.js +1 -0
- package/clis/doubao/auth.js +28 -0
- package/clis/doubao/detail.js +1 -0
- package/clis/doubao/history.js +1 -0
- package/clis/doubao/meeting-summary.js +1 -0
- package/clis/doubao/meeting-transcript.js +1 -0
- package/clis/doubao/new.js +1 -0
- package/clis/doubao/read.js +1 -0
- package/clis/doubao/send.js +1 -0
- package/clis/doubao/status.js +1 -0
- package/clis/doubao/utils.js +704 -0
- package/clis/doubao-app/ask.js +1 -0
- package/clis/doubao-app/dump.js +1 -0
- package/clis/doubao-app/new.js +1 -0
- package/clis/doubao-app/read.js +1 -0
- package/clis/doubao-app/screenshot.js +1 -0
- package/clis/doubao-app/send.js +1 -0
- package/clis/doubao-app/status.js +1 -0
- package/clis/doubao-app/utils.js +64 -0
- package/clis/douyin/_shared/browser-fetch.js +28 -0
- package/clis/douyin/_shared/creation-id.js +1 -0
- package/clis/douyin/_shared/evaluate-result.js +1 -0
- package/clis/douyin/_shared/imagex-upload.js +1 -0
- package/clis/douyin/_shared/public-api.js +1 -0
- package/clis/douyin/_shared/sts2.js +1 -0
- package/clis/douyin/_shared/text-extra.js +1 -0
- package/clis/douyin/_shared/timing.js +1 -0
- package/clis/douyin/_shared/tos-upload.js +5 -0
- package/clis/douyin/_shared/transcode.js +1 -0
- package/clis/douyin/_shared/types.js +1 -0
- package/clis/douyin/_shared/vod-upload.js +5 -0
- package/clis/douyin/activities.js +1 -0
- package/clis/douyin/auth.js +1 -0
- package/clis/douyin/collections.js +1 -0
- package/clis/douyin/delete.js +76 -0
- package/clis/douyin/draft.js +166 -0
- package/clis/douyin/drafts.js +1 -0
- package/clis/douyin/hashtag.js +1 -0
- package/clis/douyin/location.js +1 -0
- package/clis/douyin/profile.js +1 -0
- package/clis/douyin/publish-image.js +64 -0
- package/clis/douyin/publish.js +14 -0
- package/clis/douyin/search.js +51 -0
- package/clis/douyin/stats.js +1 -0
- package/clis/douyin/update.js +1 -0
- package/clis/douyin/user-videos.js +1 -0
- package/clis/douyin/videos.js +1 -0
- package/clis/duckduckgo/search.js +1 -0
- package/clis/duckduckgo/suggest.js +1 -0
- package/clis/eastmoney/_secid.js +1 -0
- package/clis/eastmoney/announcement.js +1 -0
- package/clis/eastmoney/article.js +1 -0
- package/clis/eastmoney/convertible.js +1 -0
- package/clis/eastmoney/etf.js +1 -0
- package/clis/eastmoney/holders.js +1 -0
- package/clis/eastmoney/hot-rank.js +30 -0
- package/clis/eastmoney/index-board.js +1 -0
- package/clis/eastmoney/kline.js +1 -0
- package/clis/eastmoney/kuaixun.js +1 -0
- package/clis/eastmoney/longhu.js +1 -0
- package/clis/eastmoney/money-flow.js +1 -0
- package/clis/eastmoney/northbound.js +1 -0
- package/clis/eastmoney/quote.js +1 -0
- package/clis/eastmoney/rank.js +1 -0
- package/clis/eastmoney/sectors.js +1 -0
- package/clis/eastmoney/whoami.js +1 -0
- package/clis/endoflife/product.js +1 -0
- package/clis/endoflife/utils.js +1 -0
- package/clis/facebook/__fixtures__/notifications-page.html +13 -0
- package/clis/facebook/add-friend.js +24 -0
- package/clis/facebook/auth.js +1 -0
- package/clis/facebook/comment.js +18 -0
- package/clis/facebook/events.js +26 -0
- package/clis/facebook/feed.js +209 -0
- package/clis/facebook/friends.js +24 -0
- package/clis/facebook/groups.js +32 -0
- package/clis/facebook/join-group.js +25 -0
- package/clis/facebook/like.js +29 -0
- package/clis/facebook/marketplace-inbox.js +34 -0
- package/clis/facebook/marketplace-listings.js +33 -0
- package/clis/facebook/memories.js +21 -0
- package/clis/facebook/notifications.js +31 -0
- package/clis/facebook/post.js +88 -0
- package/clis/facebook/profile.js +18 -0
- package/clis/facebook/search.js +22 -0
- package/clis/flathub/app.js +1 -0
- package/clis/flathub/search.js +1 -0
- package/clis/flathub/utils.js +1 -0
- package/clis/flomo/auth.js +22 -0
- package/clis/flomo/memos.js +13 -0
- package/clis/gemini/ask.js +1 -0
- package/clis/gemini/auth.js +14 -0
- package/clis/gemini/deep-research-result.js +4 -0
- package/clis/gemini/deep-research.js +1 -0
- package/clis/gemini/detail.js +1 -0
- package/clis/gemini/history.js +1 -0
- package/clis/gemini/image.js +3 -0
- package/clis/gemini/new.js +1 -0
- package/clis/gemini/read.js +1 -0
- package/clis/gemini/status.js +1 -0
- package/clis/gemini/utils.js +1234 -0
- package/clis/geogebra/add-circle.js +1 -0
- package/clis/geogebra/add-line.js +1 -0
- package/clis/geogebra/add-point.js +1 -0
- package/clis/geogebra/add-polygon.js +1 -0
- package/clis/geogebra/eval.js +1 -0
- package/clis/geogebra/hexagon.js +1 -0
- package/clis/geogebra/info.js +13 -0
- package/clis/geogebra/list.js +1 -0
- package/clis/geogebra/triangle.js +1 -0
- package/clis/geogebra/utils.js +99 -0
- package/clis/ghost/publish.js +1 -0
- package/clis/ghost/shared.js +1 -0
- package/clis/ghost/whoami.js +1 -0
- package/clis/gitee/auth.js +12 -0
- package/clis/gitee/index.js +1 -0
- package/clis/gitee/search.js +1 -0
- package/clis/gitee/trending.js +240 -0
- package/clis/gitee/user.js +71 -0
- package/clis/github/auth.js +7 -0
- package/clis/github-trending/repos.js +1 -0
- package/clis/google/news.js +1 -0
- package/clis/google/search.js +90 -0
- package/clis/google/suggest.js +1 -0
- package/clis/google/trends.js +1 -0
- package/clis/google/utils.js +1 -0
- package/clis/google-scholar/cite.js +20 -0
- package/clis/google-scholar/profile.js +36 -0
- package/clis/google-scholar/search.js +35 -0
- package/clis/goproxy/module.js +1 -0
- package/clis/goproxy/utils.js +1 -0
- package/clis/goproxy/versions.js +1 -0
- package/clis/gov-law/recent.js +1 -0
- package/clis/gov-law/search.js +14 -0
- package/clis/gov-law/shared.js +29 -0
- package/clis/gov-policy/__fixtures__/recent.html +16 -0
- package/clis/gov-policy/__fixtures__/search.html +41 -0
- package/clis/gov-policy/recent.js +8 -0
- package/clis/gov-policy/search.js +8 -0
- package/clis/gov-policy/utils.js +1 -0
- package/clis/grok/ask.js +1 -0
- package/clis/grok/auth.js +17 -0
- package/clis/grok/delete.js +1 -0
- package/clis/grok/detail.js +1 -0
- package/clis/grok/export-all.js +170 -0
- package/clis/grok/export-utils.js +1 -0
- package/clis/grok/export.js +106 -0
- package/clis/grok/history.js +1 -0
- package/clis/grok/image.js +119 -0
- package/clis/grok/image.test.ts +127 -0
- package/clis/grok/new.js +1 -0
- package/clis/grok/pin.js +1 -0
- package/clis/grok/read.js +1 -0
- package/clis/grok/send.js +1 -0
- package/clis/grok/status.js +1 -0
- package/clis/grok/utils.js +337 -0
- package/clis/guazi/__fixtures__/detail.html +7 -0
- package/clis/guazi/__fixtures__/list.html +5 -0
- package/clis/guazi/browse.js +1 -0
- package/clis/guazi/car.js +1 -0
- package/clis/guazi/utils.js +1 -0
- package/clis/hackernews/ask.js +1 -0
- package/clis/hackernews/auth.js +9 -0
- package/clis/hackernews/best.js +1 -0
- package/clis/hackernews/comment.js +61 -0
- package/clis/hackernews/jobs.js +1 -0
- package/clis/hackernews/new.js +1 -0
- package/clis/hackernews/read.js +11 -0
- package/clis/hackernews/search.js +1 -0
- package/clis/hackernews/show.js +1 -0
- package/clis/hackernews/submit.js +65 -0
- package/clis/hackernews/top.js +1 -0
- package/clis/hackernews/user.js +1 -0
- package/clis/hashnode/auth.js +11 -0
- package/clis/hashnode/publish.js +92 -0
- package/clis/hf/auth.js +12 -0
- package/clis/hf/datasets.js +1 -0
- package/clis/hf/models.js +1 -0
- package/clis/hf/paper.js +1 -0
- package/clis/hf/spaces.js +1 -0
- package/clis/hf/top.js +1 -0
- package/clis/homebrew/cask.js +1 -0
- package/clis/homebrew/formula.js +1 -0
- package/clis/homebrew/popular.js +1 -0
- package/clis/homebrew/utils.js +1 -0
- package/clis/huodongxing/events.js +1 -0
- package/clis/hupu/__fixtures__/hot-home.html +64 -0
- package/clis/hupu/auth.js +14 -0
- package/clis/hupu/detail.js +7 -0
- package/clis/hupu/hot.js +14 -0
- package/clis/hupu/like.js +1 -0
- package/clis/hupu/mentions.js +91 -0
- package/clis/hupu/reply.js +1 -0
- package/clis/hupu/search.js +1 -0
- package/clis/hupu/unlike.js +1 -0
- package/clis/hupu/utils.js +243 -0
- package/clis/imdb/person.js +140 -0
- package/clis/imdb/reviews.js +40 -0
- package/clis/imdb/search.js +113 -0
- package/clis/imdb/title.js +1 -0
- package/clis/imdb/top.js +1 -0
- package/clis/imdb/trending.js +1 -0
- package/clis/imdb/utils.js +162 -0
- package/clis/imooc/article.js +59 -0
- package/clis/imooc/login.js +1 -0
- package/clis/imooc/whoami.js +1 -0
- package/clis/indeed/job.js +20 -0
- package/clis/indeed/search.js +37 -0
- package/clis/indeed/utils.js +1 -0
- package/clis/infoq/article.js +19 -0
- package/clis/infoq/login.js +1 -0
- package/clis/infoq/whoami.js +1 -0
- package/clis/instagram/_shared/private-publish.js +75 -0
- package/clis/instagram/_shared/protocol-capture.js +180 -0
- package/clis/instagram/_shared/runtime-info.js +33 -0
- package/clis/instagram/auth.js +22 -0
- package/clis/instagram/collection-create.js +38 -0
- package/clis/instagram/collection-delete.js +72 -0
- package/clis/instagram/comment.js +26 -0
- package/clis/instagram/detail.js +2 -0
- package/clis/instagram/download.js +83 -0
- package/clis/instagram/explore.js +27 -0
- package/clis/instagram/follow.js +24 -0
- package/clis/instagram/followers.js +30 -0
- package/clis/instagram/following.js +74 -0
- package/clis/instagram/like.js +25 -0
- package/clis/instagram/note.js +162 -0
- package/clis/instagram/post.js +718 -0
- package/clis/instagram/profile.js +25 -0
- package/clis/instagram/reel.js +452 -0
- package/clis/instagram/save.js +25 -0
- package/clis/instagram/saved.js +37 -0
- package/clis/instagram/search.js +23 -0
- package/clis/instagram/story.js +21 -0
- package/clis/instagram/unfollow.js +21 -0
- package/clis/instagram/unlike.js +25 -0
- package/clis/instagram/unsave.js +25 -0
- package/clis/instagram/user.js +1 -0
- package/clis/jd/add-cart.js +22 -0
- package/clis/jd/auth.js +12 -0
- package/clis/jd/cart.js +59 -0
- package/clis/jd/detail.js +42 -0
- package/clis/jd/item.js +98 -0
- package/clis/jd/item.test.ts +517 -0
- package/clis/jd/reviews.js +31 -0
- package/clis/jd/search.js +42 -0
- package/clis/jianshu/article.js +1 -0
- package/clis/jianshu/login.js +1 -0
- package/clis/jianshu/notebooks.js +1 -0
- package/clis/jianshu/whoami.js +1 -0
- package/clis/jianyu/auth.js +28 -0
- package/clis/jianyu/detail.js +1 -0
- package/clis/jianyu/search.js +73 -0
- package/clis/jianyu/shared/china-bid-search.js +86 -0
- package/clis/jianyu/shared/procurement-contract.js +1 -0
- package/clis/jianyu/shared/procurement-detail.js +18 -0
- package/clis/jike/auth.js +19 -0
- package/clis/jike/comment.js +82 -0
- package/clis/jike/create.js +83 -0
- package/clis/jike/feed.js +32 -0
- package/clis/jike/like.js +38 -0
- package/clis/jike/notifications.js +115 -0
- package/clis/jike/post.js +33 -0
- package/clis/jike/repost.js +67 -0
- package/clis/jike/search.js +29 -0
- package/clis/jike/topic.js +20 -0
- package/clis/jike/user.js +19 -0
- package/clis/jike/utils.js +15 -0
- package/clis/jimeng/auth.js +13 -0
- package/clis/jimeng/generate.js +60 -0
- package/clis/jimeng/history.js +32 -0
- package/clis/jimeng/new.js +26 -0
- package/clis/jimeng/workspaces.js +22 -0
- package/clis/jira/attachments.js +1 -0
- package/clis/jira/comments.js +1 -0
- package/clis/jira/issue.js +1 -0
- package/clis/jira/links.js +1 -0
- package/clis/jira/search.js +1 -0
- package/clis/jira/shared.js +1 -0
- package/clis/juejin/article.js +5 -0
- package/clis/juejin/categories.js +1 -0
- package/clis/juejin/hot.js +1 -0
- package/clis/juejin/login.js +1 -0
- package/clis/juejin/recommend.js +1 -0
- package/clis/juejin/stats.js +53 -0
- package/clis/juejin/tags.js +1 -0
- package/clis/juejin/utils.js +1 -0
- package/clis/juejin/whoami.js +1 -0
- package/clis/ke/auth.js +14 -0
- package/clis/ke/chengjiao.js +45 -0
- package/clis/ke/ershoufang.js +50 -0
- package/clis/ke/utils.js +21 -0
- package/clis/ke/xiaoqu.js +45 -0
- package/clis/ke/zufang.js +50 -0
- package/clis/kimi/_utils.js +38 -0
- package/clis/kimi/audit-extras.js +64 -0
- package/clis/kimi/auth.js +17 -0
- package/clis/kimi/chat.js +77 -0
- package/clis/kimi/storage.js +14 -0
- package/clis/kimi/ui.js +89 -0
- package/clis/kimi/usage.js +51 -0
- package/clis/kuaishou/auth.js +1 -0
- package/clis/kuaishou/publish.js +53 -0
- package/clis/lesswrong/_helpers.js +9 -0
- package/clis/lesswrong/comments.js +9 -0
- package/clis/lesswrong/curated.js +5 -0
- package/clis/lesswrong/frontpage.js +5 -0
- package/clis/lesswrong/new.js +5 -0
- package/clis/lesswrong/read.js +5 -0
- package/clis/lesswrong/sequences.js +5 -0
- package/clis/lesswrong/shortform.js +5 -0
- package/clis/lesswrong/tag.js +5 -0
- package/clis/lesswrong/tags.js +5 -0
- package/clis/lesswrong/top-month.js +5 -0
- package/clis/lesswrong/top-week.js +5 -0
- package/clis/lesswrong/top-year.js +5 -0
- package/clis/lesswrong/top.js +5 -0
- package/clis/lesswrong/user-posts.js +5 -0
- package/clis/lesswrong/user.js +5 -0
- package/clis/lichess/top.js +1 -0
- package/clis/lichess/user.js +1 -0
- package/clis/lichess/utils.js +1 -0
- package/clis/linkedin/auth.js +27 -0
- package/clis/linkedin/comment.js +1 -0
- package/clis/linkedin/connect.js +244 -0
- package/clis/linkedin/create.js +113 -0
- package/clis/linkedin/follow.js +1 -0
- package/clis/linkedin/inbox.js +1 -0
- package/clis/linkedin/job-detail.js +40 -0
- package/clis/linkedin/jobs-preferences.js +34 -0
- package/clis/linkedin/like.js +1 -0
- package/clis/linkedin/notifications.js +1 -0
- package/clis/linkedin/people-search.js +1 -0
- package/clis/linkedin/post-analytics.js +1 -0
- package/clis/linkedin/post-comments.js +1 -0
- package/clis/linkedin/post-detail.js +1 -0
- package/clis/linkedin/posts-core.js +138 -0
- package/clis/linkedin/posts.js +1 -0
- package/clis/linkedin/profile-analytics.js +1 -0
- package/clis/linkedin/profile-api.js +218 -0
- package/clis/linkedin/profile-experience.js +1 -0
- package/clis/linkedin/profile-projects.js +1 -0
- package/clis/linkedin/profile-read.js +3 -0
- package/clis/linkedin/reply.js +1 -0
- package/clis/linkedin/repost.js +1 -0
- package/clis/linkedin/safe-send.js +155 -0
- package/clis/linkedin/salesnav-inbox.js +21 -0
- package/clis/linkedin/salesnav-message.js +33 -0
- package/clis/linkedin/salesnav-search.js +15 -0
- package/clis/linkedin/salesnav-thread.js +1 -0
- package/clis/linkedin/search-api.js +42 -0
- package/clis/linkedin/search.js +50 -0
- package/clis/linkedin/sent-invitations.js +46 -0
- package/clis/linkedin/services-read.js +57 -0
- package/clis/linkedin/shared.js +10 -0
- package/clis/linkedin/social-api.js +260 -0
- package/clis/linkedin/thread-snapshot.js +81 -0
- package/clis/linkedin/timeline.js +37 -0
- package/clis/linkedin-learning/auth.js +27 -0
- package/clis/linkedin-learning/course.js +17 -0
- package/clis/linkedin-learning/search.js +17 -0
- package/clis/linkedin-learning/trending.js +17 -0
- package/clis/linux-do/auth.js +20 -0
- package/clis/linux-do/categories.js +1 -0
- package/clis/linux-do/feed.js +19 -0
- package/clis/linux-do/search.js +1 -0
- package/clis/linux-do/tags.js +1 -0
- package/clis/linux-do/topic-content.js +28 -0
- package/clis/linux-do/topic.js +1 -0
- package/clis/linux-do/user-posts.js +1 -0
- package/clis/linux-do/user-topics.js +1 -0
- package/clis/lobsters/active.js +1 -0
- package/clis/lobsters/domain.js +1 -0
- package/clis/lobsters/hot.js +1 -0
- package/clis/lobsters/newest.js +1 -0
- package/clis/lobsters/read.js +11 -0
- package/clis/lobsters/tag.js +1 -0
- package/clis/maimai/auth.js +19 -0
- package/clis/maimai/search-talents.js +37 -0
- package/clis/manus/_utils.js +28 -0
- package/clis/manus/auth.js +20 -0
- package/clis/manus/connectors.js +4 -0
- package/clis/manus/credits.js +4 -0
- package/clis/manus/list.js +7 -0
- package/clis/manus/read.js +7 -0
- package/clis/manus/skills.js +4 -0
- package/clis/manus/status.js +8 -0
- package/clis/mastodon/post.js +1 -0
- package/clis/mastodon/shared.js +48 -0
- package/clis/mastodon/whoami.js +1 -0
- package/clis/maven/artifact.js +1 -0
- package/clis/maven/search.js +1 -0
- package/clis/maven/utils.js +1 -0
- package/clis/mdn/search.js +1 -0
- package/clis/medium/article.js +12 -0
- package/clis/medium/feed.js +1 -0
- package/clis/medium/login.js +1 -0
- package/clis/medium/search.js +1 -0
- package/clis/medium/stats.js +56 -0
- package/clis/medium/tag.js +1 -0
- package/clis/medium/user.js +1 -0
- package/clis/medium/utils.js +62 -0
- package/clis/medium/whoami.js +1 -0
- package/clis/mubu/doc.js +1 -0
- package/clis/mubu/docs.js +1 -0
- package/clis/mubu/notes.js +1 -0
- package/clis/mubu/recent.js +1 -0
- package/clis/mubu/search.js +1 -0
- package/clis/mubu/utils.js +31 -0
- package/clis/note/auth.js +12 -0
- package/clis/note/note-utils.js +2 -0
- package/clis/note/publish.js +17 -0
- package/clis/notebooklm/add-source.js +46 -0
- package/clis/notebooklm/auth.js +21 -0
- package/clis/notebooklm/create.js +1 -0
- package/clis/notebooklm/current.js +1 -0
- package/clis/notebooklm/generate-audio.js +1 -0
- package/clis/notebooklm/generate-slides.js +1 -0
- package/clis/notebooklm/get.js +1 -0
- package/clis/notebooklm/history.js +1 -0
- package/clis/notebooklm/list.js +1 -0
- package/clis/notebooklm/note-list.js +1 -0
- package/clis/notebooklm/notes-get.js +1 -0
- package/clis/notebooklm/open.js +1 -0
- package/clis/notebooklm/rpc.js +36 -0
- package/clis/notebooklm/shared.js +1 -0
- package/clis/notebooklm/source-fulltext.js +1 -0
- package/clis/notebooklm/source-get.js +1 -0
- package/clis/notebooklm/source-guide.js +1 -0
- package/clis/notebooklm/source-list.js +1 -0
- package/clis/notebooklm/status.js +1 -0
- package/clis/notebooklm/summary.js +1 -0
- package/clis/notebooklm/utils.js +172 -0
- package/clis/notebooklm/write-note.js +1 -0
- package/clis/nowcoder/auth.js +24 -0
- package/clis/nowcoder/comment.js +1 -0
- package/clis/nowcoder/comments.js +1 -0
- package/clis/nowcoder/companies.js +1 -0
- package/clis/nowcoder/creators.js +1 -0
- package/clis/nowcoder/delete.js +1 -0
- package/clis/nowcoder/detail.js +46 -0
- package/clis/nowcoder/dm-list.js +1 -0
- package/clis/nowcoder/dm-read.js +1 -0
- package/clis/nowcoder/dm-send.js +1 -0
- package/clis/nowcoder/drafts.js +1 -0
- package/clis/nowcoder/experience.js +20 -0
- package/clis/nowcoder/hot.js +1 -0
- package/clis/nowcoder/inbox.js +1 -0
- package/clis/nowcoder/jobs.js +1 -0
- package/clis/nowcoder/like.js +1 -0
- package/clis/nowcoder/my.js +1 -0
- package/clis/nowcoder/notifications.js +16 -0
- package/clis/nowcoder/papers.js +22 -0
- package/clis/nowcoder/post.js +1 -0
- package/clis/nowcoder/practice.js +21 -0
- package/clis/nowcoder/recommend.js +1 -0
- package/clis/nowcoder/referral.js +21 -0
- package/clis/nowcoder/salary.js +22 -0
- package/clis/nowcoder/search.js +31 -0
- package/clis/nowcoder/suggest.js +17 -0
- package/clis/nowcoder/topics.js +1 -0
- package/clis/nowcoder/trending.js +1 -0
- package/clis/nowcoder/utils.js +68 -0
- package/clis/npm/downloads.js +1 -0
- package/clis/npm/package.js +1 -0
- package/clis/npm/search.js +1 -0
- package/clis/npm/utils.js +1 -0
- package/clis/nuget/package.js +1 -0
- package/clis/nuget/search.js +1 -0
- package/clis/nuget/utils.js +1 -0
- package/clis/nvd/cve.js +1 -0
- package/clis/oeis/search.js +1 -0
- package/clis/oeis/sequence.js +1 -0
- package/clis/oeis/utils.js +1 -0
- package/clis/ones/common.js +23 -0
- package/clis/ones/enrich-tasks.js +1 -0
- package/clis/ones/login.js +2 -0
- package/clis/ones/logout.js +1 -0
- package/clis/ones/me.js +1 -0
- package/clis/ones/my-tasks.js +1 -0
- package/clis/ones/resolve-labels.js +1 -0
- package/clis/ones/task-helpers.js +1 -0
- package/clis/ones/task.js +1 -0
- package/clis/ones/tasks.js +1 -0
- package/clis/ones/token-info.js +1 -0
- package/clis/ones/worklog.js +14 -0
- package/clis/openalex/search.js +1 -0
- package/clis/openalex/utils.js +1 -0
- package/clis/openalex/work.js +1 -0
- package/clis/openfda/drug-label.js +1 -0
- package/clis/openfda/food-recall.js +1 -0
- package/clis/openfda/utils.js +1 -0
- package/clis/openreview/author.js +1 -0
- package/clis/openreview/paper.js +1 -0
- package/clis/openreview/reviews.js +4 -0
- package/clis/openreview/search.js +1 -0
- package/clis/openreview/utils.js +1 -0
- package/clis/openreview/venue.js +1 -0
- package/clis/oschina/article.js +1 -0
- package/clis/oschina/catalogs.js +1 -0
- package/clis/oschina/login.js +1 -0
- package/clis/oschina/stats.js +54 -0
- package/clis/oschina/whoami.js +1 -0
- package/clis/osv/query.js +1 -0
- package/clis/osv/utils.js +1 -0
- package/clis/osv/vulnerability.js +1 -0
- package/clis/packagist/package.js +1 -0
- package/clis/packagist/search.js +1 -0
- package/clis/packagist/utils.js +1 -0
- package/clis/paperreview/feedback.js +1 -0
- package/clis/paperreview/review.js +1 -0
- package/clis/paperreview/submit.js +1 -0
- package/clis/paperreview/utils.js +1 -0
- package/clis/pinterest/api.js +1 -0
- package/clis/pinterest/auth.js +1 -0
- package/clis/pinterest/boards.js +1 -0
- package/clis/pinterest/client.js +20 -0
- package/clis/pinterest/publish.js +13 -0
- package/clis/pixiv/auth.js +17 -0
- package/clis/pixiv/detail.js +1 -0
- package/clis/pixiv/download.js +1 -0
- package/clis/pixiv/illusts.js +1 -0
- package/clis/pixiv/ranking.js +26 -0
- package/clis/pixiv/search.js +1 -0
- package/clis/pixiv/user.js +1 -0
- package/clis/pixiv/utils.js +18 -0
- package/clis/powerchina/auth.js +17 -0
- package/clis/powerchina/search.js +1 -0
- package/clis/producthunt/browse.js +54 -0
- package/clis/producthunt/hot.js +64 -0
- package/clis/producthunt/posts.js +1 -0
- package/clis/producthunt/today.js +1 -0
- package/clis/producthunt/utils.js +1 -0
- package/clis/pubmed/article.js +1 -0
- package/clis/pubmed/author.js +1 -0
- package/clis/pubmed/citations.js +1 -0
- package/clis/pubmed/clinical-trial.js +1 -0
- package/clis/pubmed/journal.js +1 -0
- package/clis/pubmed/mesh.js +1 -0
- package/clis/pubmed/related.js +1 -0
- package/clis/pubmed/review.js +1 -0
- package/clis/pubmed/search.js +1 -0
- package/clis/pubmed/utils.js +1 -0
- package/clis/pypi/downloads.js +1 -0
- package/clis/pypi/package.js +1 -0
- package/clis/pypi/utils.js +1 -0
- package/clis/qiita/auth.js +1 -0
- package/clis/qiita/gql.js +32 -0
- package/clis/qiita/publish.js +7 -0
- package/clis/qiita/stats.js +37 -0
- package/clis/qoder/_utils.js +113 -0
- package/clis/qoder/composer.js +1 -0
- package/clis/qoder/history.js +25 -0
- package/clis/qoder/quest.js +1 -0
- package/clis/qoder/read.js +1 -0
- package/clis/qoder/status.js +1 -0
- package/clis/qoder/ui.js +59 -0
- package/clis/quark/auth.js +16 -0
- package/clis/quark/ls.js +1 -0
- package/clis/quark/mkdir.js +1 -0
- package/clis/quark/mv.js +1 -0
- package/clis/quark/rename.js +1 -0
- package/clis/quark/rm.js +1 -0
- package/clis/quark/save.js +1 -0
- package/clis/quark/share-tree.js +1 -0
- package/clis/quark/utils.js +13 -0
- package/clis/quora/create-answer.js +22 -0
- package/clis/quora/create-question.js +24 -0
- package/clis/quora/shared.js +43 -0
- package/clis/quora/whoami.js +1 -0
- package/clis/qwen/ask.js +1 -0
- package/clis/qwen/auth.js +17 -0
- package/clis/qwen/detail.js +1 -0
- package/clis/qwen/history.js +1 -0
- package/clis/qwen/image.js +31 -0
- package/clis/qwen/new.js +1 -0
- package/clis/qwen/read.js +1 -0
- package/clis/qwen/send.js +1 -0
- package/clis/qwen/status.js +1 -0
- package/clis/qwen/utils.js +185 -0
- package/clis/reddit/auth.js +17 -0
- package/clis/reddit/comment.js +36 -0
- package/clis/reddit/frontpage.js +40 -0
- package/clis/reddit/home.js +32 -0
- package/clis/reddit/hot.js +46 -0
- package/clis/reddit/popular.js +46 -0
- package/clis/reddit/read.js +398 -0
- package/clis/reddit/reply.js +56 -0
- package/clis/reddit/save.js +30 -0
- package/clis/reddit/saved.js +24 -0
- package/clis/reddit/search.js +51 -0
- package/clis/reddit/submit.js +42 -0
- package/clis/reddit/subreddit-info.js +29 -0
- package/clis/reddit/subreddit.js +52 -0
- package/clis/reddit/subscribe.js +29 -0
- package/clis/reddit/subscribed.js +68 -0
- package/clis/reddit/upvote.js +43 -0
- package/clis/reddit/upvoted.js +24 -0
- package/clis/reddit/user-comments.js +20 -0
- package/clis/reddit/user-posts.js +17 -0
- package/clis/reddit/user.js +20 -0
- package/clis/reddit/whoami.js +19 -0
- package/clis/rednote/auth.js +19 -0
- package/clis/rednote/comments.js +1 -0
- package/clis/rednote/download.js +1 -0
- package/clis/rednote/feed.js +1 -0
- package/clis/rednote/note.js +1 -0
- package/clis/rednote/notifications.js +67 -0
- package/clis/rednote/search.js +32 -0
- package/clis/rednote/user.js +1 -0
- package/clis/rest-countries/country.js +1 -0
- package/clis/rest-countries/region.js +1 -0
- package/clis/rest-countries/utils.js +1 -0
- package/clis/reuters/article-detail.js +1 -0
- package/clis/reuters/auth.js +39 -0
- package/clis/reuters/search.js +1 -0
- package/clis/reuters/utils.js +50 -0
- package/clis/rfc/rfc.js +1 -0
- package/clis/rfc/utils.js +1 -0
- package/clis/rubygems/gem.js +1 -0
- package/clis/rubygems/search.js +1 -0
- package/clis/rubygems/utils.js +1 -0
- package/clis/segmentfault/_signed-request.js +43 -0
- package/clis/segmentfault/article.js +3 -0
- package/clis/segmentfault/channels.js +1 -0
- package/clis/segmentfault/login.js +1 -0
- package/clis/segmentfault/stats.js +82 -0
- package/clis/segmentfault/tags.js +1 -0
- package/clis/segmentfault/whoami.js +1 -0
- package/clis/semanticscholar/citations.js +1 -0
- package/clis/semanticscholar/paper.js +1 -0
- package/clis/semanticscholar/recommendations.js +1 -0
- package/clis/semanticscholar/search.js +1 -0
- package/clis/semanticscholar/utils.js +1 -0
- package/clis/sinablog/article.js +1 -0
- package/clis/sinablog/hot.js +1 -0
- package/clis/sinablog/search.js +1 -0
- package/clis/sinablog/user.js +1 -0
- package/clis/sinablog/utils.js +153 -0
- package/clis/sinafinance/news.js +1 -0
- package/clis/sinafinance/rolling-news.js +20 -0
- package/clis/sinafinance/stock-rank.js +41 -0
- package/clis/sinafinance/stock.js +1 -0
- package/clis/slock/attachment-download.js +1 -0
- package/clis/slock/attachment-upload.js +34 -0
- package/clis/slock/attachment-url.js +1 -0
- package/clis/slock/auth-verify.js +1 -0
- package/clis/slock/bookmark-add.js +11 -0
- package/clis/slock/bookmark-list.js +10 -0
- package/clis/slock/bookmark-remove.js +7 -0
- package/clis/slock/channel-action.js +1 -0
- package/clis/slock/channel-archive.js +1 -0
- package/clis/slock/channel-create.js +1 -0
- package/clis/slock/channel-files.js +1 -0
- package/clis/slock/channel-info.js +1 -0
- package/clis/slock/channel-join.js +1 -0
- package/clis/slock/channel-leave.js +1 -0
- package/clis/slock/channel-list.js +1 -0
- package/clis/slock/channel-mark.js +1 -0
- package/clis/slock/channel-members.js +1 -0
- package/clis/slock/channel-unarchive.js +1 -0
- package/clis/slock/dm-list.js +1 -0
- package/clis/slock/errors.js +1 -0
- package/clis/slock/in-page.js +113 -0
- package/clis/slock/inbox-done.js +9 -0
- package/clis/slock/inbox-read-all.js +1 -0
- package/clis/slock/inbox.js +1 -0
- package/clis/slock/login.js +1 -0
- package/clis/slock/message-read.js +61 -0
- package/clis/slock/message-search.js +24 -0
- package/clis/slock/message-send.js +55 -0
- package/clis/slock/reaction-add.js +1 -0
- package/clis/slock/reaction-remove.js +1 -0
- package/clis/slock/resolve.js +1 -0
- package/clis/slock/server-list.js +9 -0
- package/clis/slock/server-use.js +18 -0
- package/clis/slock/shared.js +1 -0
- package/clis/slock/task-claim.js +14 -0
- package/clis/slock/task-convert.js +35 -0
- package/clis/slock/task-create.js +24 -0
- package/clis/slock/task-delete.js +9 -0
- package/clis/slock/task-get.js +11 -0
- package/clis/slock/task-list-server.js +12 -0
- package/clis/slock/task-list.js +14 -0
- package/clis/slock/task-status.js +19 -0
- package/clis/slock/task-unclaim.js +13 -0
- package/clis/slock/thread-done.js +1 -0
- package/clis/slock/thread-follow.js +1 -0
- package/clis/slock/thread-list.js +1 -0
- package/clis/slock/thread-state.js +1 -0
- package/clis/slock/thread-undone.js +1 -0
- package/clis/slock/thread-unfollow.js +1 -0
- package/clis/slock/unread-summary.js +18 -0
- package/clis/slock/whoami.js +1 -0
- package/clis/smzdm/search.js +71 -0
- package/clis/sohu/article.js +1 -0
- package/clis/sohu/attributes.js +1 -0
- package/clis/sohu/categories.js +1 -0
- package/clis/sohu/channels.js +1 -0
- package/clis/sohu/columns.js +1 -0
- package/clis/sohu/login.js +1 -0
- package/clis/sohu/mpbp.js +1 -0
- package/clis/sohu/stats.js +95 -0
- package/clis/sohu/topics.js +1 -0
- package/clis/sohu/whoami.js +1 -0
- package/clis/spotify/spotify.js +1 -0
- package/clis/spotify/utils.js +8 -0
- package/clis/stackoverflow/bounties.js +1 -0
- package/clis/stackoverflow/hot.js +1 -0
- package/clis/stackoverflow/read.js +13 -0
- package/clis/stackoverflow/related.js +1 -0
- package/clis/stackoverflow/search.js +1 -0
- package/clis/stackoverflow/tag.js +1 -0
- package/clis/stackoverflow/unanswered.js +1 -0
- package/clis/stackoverflow/user.js +1 -0
- package/clis/stackoverflow/utils.js +1 -0
- package/clis/steam/app.js +1 -0
- package/clis/steam/search.js +1 -0
- package/clis/steam/top-sellers.js +1 -0
- package/clis/steam/utils.js +1 -0
- package/clis/substack/auth.js +11 -0
- package/clis/substack/feed.js +1 -0
- package/clis/substack/post-utils.js +2 -0
- package/clis/substack/publication.js +1 -0
- package/clis/substack/publish.js +10 -0
- package/clis/substack/search.js +1 -0
- package/clis/substack/utils.js +108 -0
- package/clis/suno/auth.js +21 -0
- package/clis/suno/download.js +17 -0
- package/clis/suno/generate.js +4 -0
- package/clis/suno/list.js +14 -0
- package/clis/suno/status.js +1 -0
- package/clis/suno/utils.js +102 -0
- package/clis/taobao/add-cart.js +93 -0
- package/clis/taobao/auth.js +8 -0
- package/clis/taobao/cart.js +68 -0
- package/clis/taobao/detail.js +48 -0
- package/clis/taobao/reviews.js +52 -0
- package/clis/taobao/search.js +64 -0
- package/clis/tdx/hot-rank.js +25 -0
- package/clis/telegram/send.js +18 -0
- package/clis/telegram/shared.js +21 -0
- package/clis/telegram/whoami.js +1 -0
- package/clis/test-utils.js +1 -0
- package/clis/threads/post.js +152 -0
- package/clis/threads/shared.js +27 -0
- package/clis/threads/whoami.js +1 -0
- package/clis/ths/hot-rank.js +27 -0
- package/clis/tieba/hot.js +16 -0
- package/clis/tieba/posts.js +1 -0
- package/clis/tieba/read.js +84 -0
- package/clis/tieba/search.js +54 -0
- package/clis/tieba/utils.js +1 -0
- package/clis/tiktok/auth.js +30 -0
- package/clis/tiktok/comment.js +69 -0
- package/clis/tiktok/creator-videos.js +45 -0
- package/clis/tiktok/explore.js +76 -0
- package/clis/tiktok/follow.js +49 -0
- package/clis/tiktok/following.js +103 -0
- package/clis/tiktok/friends.js +79 -0
- package/clis/tiktok/like.js +19 -0
- package/clis/tiktok/live.js +79 -0
- package/clis/tiktok/notifications.js +77 -0
- package/clis/tiktok/profile.js +26 -0
- package/clis/tiktok/publish.js +82 -0
- package/clis/tiktok/save.js +15 -0
- package/clis/tiktok/search.js +24 -0
- package/clis/tiktok/unfollow.js +59 -0
- package/clis/tiktok/unlike.js +19 -0
- package/clis/tiktok/unsave.js +17 -0
- package/clis/tiktok/user.js +143 -0
- package/clis/tiktok/utils.js +272 -0
- package/clis/toutiao/article.js +1 -0
- package/clis/toutiao/articles.js +6 -0
- package/clis/toutiao/auth.js +50 -0
- package/clis/toutiao/hot.js +1 -0
- package/clis/toutiao/utils.js +2 -0
- package/clis/trae-cn/activity.js +1 -0
- package/clis/trae-cn/approve.js +1 -0
- package/clis/trae-cn/ask.js +1 -0
- package/clis/trae-cn/dump.js +1 -0
- package/clis/trae-cn/export.js +3 -0
- package/clis/trae-cn/model.js +1 -0
- package/clis/trae-cn/new.js +1 -0
- package/clis/trae-cn/read.js +1 -0
- package/clis/trae-cn/screenshot.js +1 -0
- package/clis/trae-cn/select-model.js +1 -0
- package/clis/trae-cn/send.js +1 -0
- package/clis/trae-cn/setup.js +1 -0
- package/clis/trae-cn/status.js +1 -0
- package/clis/trae-cn/targets.js +1 -0
- package/clis/trae-cn/utils.js +456 -0
- package/clis/trae-cn/watch.js +3 -0
- package/clis/trae-solo/_actions.js +41 -0
- package/clis/trae-solo/_fs.js +6 -0
- package/clis/trae-solo/_state.js +2 -0
- package/clis/trae-solo/automation.js +43 -0
- package/clis/trae-solo/history.js +15 -0
- package/clis/trae-solo/mode.js +31 -0
- package/clis/trae-solo/model.js +50 -0
- package/clis/trae-solo/renderer-storage.js +11 -0
- package/clis/trae-solo/settings.js +1 -0
- package/clis/trae-solo/skill-fs.js +1 -0
- package/clis/trae-solo/skill.js +81 -0
- package/clis/trae-solo/state-fs.js +2 -0
- package/clis/trae-solo/status.js +1 -0
- package/clis/trae-solo/task-fs.js +5 -0
- package/clis/trae-solo/user-rules.js +1 -0
- package/clis/trae-solo/workspaces-fs.js +1 -0
- package/clis/tumblr/auth.js +24 -0
- package/clis/tumblr/publish.js +14 -0
- package/clis/tvmaze/search.js +1 -0
- package/clis/tvmaze/show.js +1 -0
- package/clis/tvmaze/utils.js +1 -0
- package/clis/twitter/accept.js +116 -0
- package/clis/twitter/article.js +116 -0
- package/clis/twitter/auth.js +4 -0
- package/clis/twitter/block.js +62 -0
- package/clis/twitter/bookmark-folder.js +4 -0
- package/clis/twitter/bookmark-folders.js +4 -0
- package/clis/twitter/bookmark.js +44 -0
- package/clis/twitter/bookmarks.js +27 -0
- package/clis/twitter/delete.js +36 -0
- package/clis/twitter/device-follow.js +13 -0
- package/clis/twitter/dm-list.js +1 -0
- package/clis/twitter/dm-read.js +1 -0
- package/clis/twitter/dm-send.js +13 -0
- package/clis/twitter/dm-shared.js +6 -0
- package/clis/twitter/download.js +38 -0
- package/clis/twitter/follow-batch.js +43 -0
- package/clis/twitter/follow.js +39 -0
- package/clis/twitter/followers.js +59 -0
- package/clis/twitter/following.js +4 -0
- package/clis/twitter/hide-reply.js +57 -0
- package/clis/twitter/like.js +48 -0
- package/clis/twitter/likes.js +14 -0
- package/clis/twitter/list-add-batch.js +1 -0
- package/clis/twitter/list-add-core.js +35 -0
- package/clis/twitter/list-add.js +1 -0
- package/clis/twitter/list-batch-utils.js +1 -0
- package/clis/twitter/list-create.js +12 -0
- package/clis/twitter/list-delete.js +36 -0
- package/clis/twitter/list-remove-batch.js +1 -0
- package/clis/twitter/list-remove-core.js +127 -0
- package/clis/twitter/list-remove.js +1 -0
- package/clis/twitter/list-tweets.js +27 -0
- package/clis/twitter/lists.js +27 -0
- package/clis/twitter/notifications.js +4 -0
- package/clis/twitter/post.js +158 -0
- package/clis/twitter/profile.js +66 -0
- package/clis/twitter/quote.js +123 -0
- package/clis/twitter/reply-dm.js +112 -0
- package/clis/twitter/reply.js +97 -0
- package/clis/twitter/retweet.js +62 -0
- package/clis/twitter/schedule.js +96 -0
- package/clis/twitter/scheduled-delete.js +60 -0
- package/clis/twitter/scheduled-list.js +15 -0
- package/clis/twitter/scheduled-utils.js +18 -0
- package/clis/twitter/search.js +12 -0
- package/clis/twitter/shared.js +76 -0
- package/clis/twitter/thread.js +4 -0
- package/clis/twitter/timeline.js +4 -0
- package/clis/twitter/trending.js +18 -0
- package/clis/twitter/tweets.js +12 -0
- package/clis/twitter/unblock.js +45 -0
- package/clis/twitter/unbookmark.js +41 -0
- package/clis/twitter/unfollow.js +45 -0
- package/clis/twitter/unlike.js +48 -0
- package/clis/twitter/unretweet.js +62 -0
- package/clis/twitter/utils.js +55 -0
- package/clis/uisdc/news.js +25 -0
- package/clis/uiverse/_shared.js +257 -0
- package/clis/uiverse/code.js +1 -0
- package/clis/uiverse/preview.js +1 -0
- package/clis/upwork/auth.js +19 -0
- package/clis/upwork/detail.js +22 -0
- package/clis/upwork/feed.js +21 -0
- package/clis/upwork/search.js +21 -0
- package/clis/upwork/utils.js +1 -0
- package/clis/v2ex/auth.js +10 -0
- package/clis/v2ex/daily.js +41 -0
- package/clis/v2ex/hot.js +1 -0
- package/clis/v2ex/latest.js +1 -0
- package/clis/v2ex/me.js +58 -0
- package/clis/v2ex/member.js +1 -0
- package/clis/v2ex/node.js +1 -0
- package/clis/v2ex/nodes.js +1 -0
- package/clis/v2ex/notifications.js +40 -0
- package/clis/v2ex/replies.js +1 -0
- package/clis/v2ex/topic.js +1 -0
- package/clis/v2ex/user.js +1 -0
- package/clis/vk/post.js +1 -0
- package/clis/vk/shared.js +8 -0
- package/clis/vk/whoami.js +1 -0
- package/clis/wanfang/search.js +42 -0
- package/clis/web/read.js +260 -0
- package/clis/wechat-channels/auth.js +31 -0
- package/clis/wechat-channels/publish.js +298 -0
- package/clis/weibo/article.js +1 -0
- package/clis/weibo/auth.js +17 -0
- package/clis/weibo/comments.js +28 -0
- package/clis/weibo/delete.js +84 -0
- package/clis/weibo/favorites.js +27 -0
- package/clis/weibo/feed.js +33 -0
- package/clis/weibo/hot.js +17 -0
- package/clis/weibo/me.js +51 -0
- package/clis/weibo/post.js +46 -0
- package/clis/weibo/publish.js +98 -0
- package/clis/weibo/search.js +47 -0
- package/clis/weibo/user-posts.js +92 -0
- package/clis/weibo/user.js +37 -0
- package/clis/weibo/utils.js +16 -0
- package/clis/weixin/article.js +1 -0
- package/clis/weixin/create-draft.js +152 -0
- package/clis/weixin/download.js +100 -0
- package/clis/weixin/drafts.js +27 -0
- package/clis/weixin/login.js +1 -0
- package/clis/weixin/search.js +44 -0
- package/clis/weixin/stats.js +43 -0
- package/clis/weixin/whoami.js +1 -0
- package/clis/weread/ai-outline.js +2 -0
- package/clis/weread/auth.js +24 -0
- package/clis/weread/book-search.js +2 -0
- package/clis/weread/book.js +3 -0
- package/clis/weread/highlights.js +1 -0
- package/clis/weread/notebooks.js +1 -0
- package/clis/weread/notes.js +1 -0
- package/clis/weread/ranking.js +1 -0
- package/clis/weread/search.js +1 -0
- package/clis/weread/shelf.js +1 -0
- package/clis/weread/utils.js +67 -0
- package/clis/weread-official/book.js +1 -0
- package/clis/weread-official/discover.js +1 -0
- package/clis/weread-official/list-apis.js +1 -0
- package/clis/weread-official/notes.js +1 -0
- package/clis/weread-official/readdata.js +1 -0
- package/clis/weread-official/review.js +1 -0
- package/clis/weread-official/search.js +1 -0
- package/clis/weread-official/shelf.js +1 -0
- package/clis/weread-official/utils.js +1 -0
- package/clis/wikidata/entity.js +1 -0
- package/clis/wikidata/search.js +1 -0
- package/clis/wikidata/utils.js +1 -0
- package/clis/wikipedia/page.js +3 -0
- package/clis/wikipedia/random.js +1 -0
- package/clis/wikipedia/search.js +1 -0
- package/clis/wikipedia/summary.js +1 -0
- package/clis/wikipedia/trending.js +1 -0
- package/clis/wikipedia/utils.js +1 -0
- package/clis/wordpress/login.js +1 -0
- package/clis/wordpress/publish.js +1 -0
- package/clis/wordpress/shared.js +54 -0
- package/clis/wordpress/whoami.js +1 -0
- package/clis/woshipm/article.js +1 -0
- package/clis/woshipm/login.js +1 -0
- package/clis/woshipm/stats.js +52 -0
- package/clis/woshipm/whoami.js +1 -0
- package/clis/wttr/current.js +1 -0
- package/clis/wttr/forecast.js +1 -0
- package/clis/wttr/utils.js +1 -0
- package/clis/xianyu/auth.js +11 -0
- package/clis/xianyu/chat.js +1 -0
- package/clis/xianyu/im.js +240 -0
- package/clis/xianyu/inbox.js +1 -0
- package/clis/xianyu/item.js +97 -0
- package/clis/xianyu/messages.js +1 -0
- package/clis/xianyu/publish.js +245 -0
- package/clis/xianyu/reply.js +1 -0
- package/clis/xianyu/search.js +141 -0
- package/clis/xianyu/utils.js +1 -0
- package/clis/xiaoe/auth.js +10 -0
- package/clis/xiaoe/catalog.js +134 -0
- package/clis/xiaoe/content.js +16 -0
- package/clis/xiaoe/courses.js +43 -0
- package/clis/xiaoe/detail.js +19 -0
- package/clis/xiaoe/play-url.js +97 -0
- package/clis/xiaohongshu/ask.js +130 -0
- package/clis/xiaohongshu/auth.js +13 -0
- package/clis/xiaohongshu/collection-helpers.js +64 -0
- package/clis/xiaohongshu/comments.js +89 -0
- package/clis/xiaohongshu/creator-note-detail.js +80 -0
- package/clis/xiaohongshu/creator-notes-summary.js +1 -0
- package/clis/xiaohongshu/creator-notes.js +107 -0
- package/clis/xiaohongshu/creator-profile.js +13 -0
- package/clis/xiaohongshu/creator-stats.js +13 -0
- package/clis/xiaohongshu/delete-note.js +69 -0
- package/clis/xiaohongshu/download.js +200 -0
- package/clis/xiaohongshu/draft-clear.js +44 -0
- package/clis/xiaohongshu/draft-delete.js +37 -0
- package/clis/xiaohongshu/draft-open.js +1 -0
- package/clis/xiaohongshu/draft-utils.js +36 -0
- package/clis/xiaohongshu/drafts.js +1 -0
- package/clis/xiaohongshu/feed.js +38 -0
- package/clis/xiaohongshu/follow.js +75 -0
- package/clis/xiaohongshu/liked.js +1 -0
- package/clis/xiaohongshu/note-helpers.js +1 -0
- package/clis/xiaohongshu/note.js +32 -0
- package/clis/xiaohongshu/notifications.js +1 -0
- package/clis/xiaohongshu/publish-video.js +87 -0
- package/clis/xiaohongshu/publish.js +637 -0
- package/clis/xiaohongshu/saved.js +1 -0
- package/clis/xiaohongshu/search.js +194 -0
- package/clis/xiaohongshu/unfollow.js +98 -0
- package/clis/xiaohongshu/user-helpers.js +1 -0
- package/clis/xiaohongshu/user.js +30 -0
- package/clis/xiaoyuzhou/auth.js +3 -0
- package/clis/xiaoyuzhou/download.js +1 -0
- package/clis/xiaoyuzhou/episode.js +1 -0
- package/clis/xiaoyuzhou/podcast-episodes.js +1 -0
- package/clis/xiaoyuzhou/podcast.js +1 -0
- package/clis/xiaoyuzhou/transcript.js +1 -0
- package/clis/xiaoyuzhou/utils.js +1 -0
- package/clis/xueqiu/article.js +4 -0
- package/clis/xueqiu/auth.js +27 -0
- package/clis/xueqiu/comments.js +38 -0
- package/clis/xueqiu/danjuan-utils.js +84 -0
- package/clis/xueqiu/earnings-date.js +1 -0
- package/clis/xueqiu/events.js +17 -0
- package/clis/xueqiu/feed.js +1 -0
- package/clis/xueqiu/fund-holdings.js +1 -0
- package/clis/xueqiu/fund-snapshot.js +1 -0
- package/clis/xueqiu/groups.js +1 -0
- package/clis/xueqiu/hashtags.js +26 -0
- package/clis/xueqiu/hot-stock.js +1 -0
- package/clis/xueqiu/hot.js +1 -0
- package/clis/xueqiu/kline.js +1 -0
- package/clis/xueqiu/search.js +1 -0
- package/clis/xueqiu/stock.js +1 -0
- package/clis/xueqiu/stocks.js +13 -0
- package/clis/xueqiu/users.js +12 -0
- package/clis/xueqiu/utils.js +9 -0
- package/clis/xueqiu/watchlist.js +1 -0
- package/clis/yahoo/search.js +21 -0
- package/clis/yahoo-finance/quote.js +50 -0
- package/clis/yollomi/background.js +1 -0
- package/clis/yollomi/edit.js +1 -0
- package/clis/yollomi/face-swap.js +1 -0
- package/clis/yollomi/generate.js +1 -0
- package/clis/yollomi/models.js +1 -0
- package/clis/yollomi/object-remover.js +1 -0
- package/clis/yollomi/remove-bg.js +1 -0
- package/clis/yollomi/restore.js +1 -0
- package/clis/yollomi/try-on.js +1 -0
- package/clis/yollomi/upload.js +17 -0
- package/clis/yollomi/upscale.js +1 -0
- package/clis/yollomi/utils.js +16 -0
- package/clis/yollomi/video.js +1 -0
- package/clis/youdao/note.js +113 -0
- package/clis/youtube/auth.js +20 -0
- package/clis/youtube/channel.js +118 -0
- package/clis/youtube/comments.js +64 -0
- package/clis/youtube/feed.js +89 -0
- package/clis/youtube/history.js +87 -0
- package/clis/youtube/like.js +33 -0
- package/clis/youtube/playlist.js +47 -0
- package/clis/youtube/publish.js +56 -0
- package/clis/youtube/search.js +39 -0
- package/clis/youtube/subscribe.js +42 -0
- package/clis/youtube/subscriptions.js +26 -0
- package/clis/youtube/transcript-group.js +2 -0
- package/clis/youtube/transcript.js +417 -0
- package/clis/youtube/unlike.js +33 -0
- package/clis/youtube/unsubscribe.js +42 -0
- package/clis/youtube/utils.js +34 -0
- package/clis/youtube/video.js +96 -0
- package/clis/youtube/watch-later.js +41 -0
- package/clis/yuanbao/ask.js +145 -0
- package/clis/yuanbao/auth.js +23 -0
- package/clis/yuanbao/detail.js +1 -0
- package/clis/yuanbao/history.js +1 -0
- package/clis/yuanbao/new.js +16 -0
- package/clis/yuanbao/read.js +1 -0
- package/clis/yuanbao/send.js +1 -0
- package/clis/yuanbao/shared.js +127 -0
- package/clis/yuanbao/status.js +1 -0
- package/clis/yuque/article.js +1 -0
- package/clis/yuque/whoami.js +1 -0
- package/clis/zhihu/answer-comments.js +11 -0
- package/clis/zhihu/answer-detail.js +11 -0
- package/clis/zhihu/answer.js +15 -0
- package/clis/zhihu/article-transform.js +1 -0
- package/clis/zhihu/article.js +7 -0
- package/clis/zhihu/auth.js +11 -0
- package/clis/zhihu/collection.js +7 -0
- package/clis/zhihu/collections.js +7 -0
- package/clis/zhihu/comment.js +17 -0
- package/clis/zhihu/download.js +39 -0
- package/clis/zhihu/favorite.js +39 -0
- package/clis/zhihu/follow.js +19 -0
- package/clis/zhihu/followers.js +1 -0
- package/clis/zhihu/following.js +1 -0
- package/clis/zhihu/hot.js +21 -0
- package/clis/zhihu/like.js +16 -0
- package/clis/zhihu/paginate.js +11 -0
- package/clis/zhihu/pin.js +24 -0
- package/clis/zhihu/pins.js +1 -0
- package/clis/zhihu/question.js +7 -0
- package/clis/zhihu/recommend.js +7 -0
- package/clis/zhihu/search.js +11 -0
- package/clis/zhihu/stats.js +41 -0
- package/clis/zhihu/target.js +1 -0
- package/clis/zhihu/text.js +6 -0
- package/clis/zhihu/user-answers.js +1 -0
- package/clis/zhihu/user-arg.js +1 -0
- package/clis/zhihu/user-articles.js +1 -0
- package/clis/zhihu/user.js +11 -0
- package/clis/zhihu/write-shared.js +71 -0
- package/clis/zlibrary/info.js +1 -0
- package/clis/zlibrary/search.js +1 -0
- package/clis/zlibrary/utils.js +48 -0
- package/clis/zsxq/auth.js +33 -0
- package/clis/zsxq/dynamics.js +1 -0
- package/clis/zsxq/groups.js +1 -0
- package/clis/zsxq/search.js +1 -0
- package/clis/zsxq/topic.js +1 -0
- package/clis/zsxq/topics.js +1 -0
- package/clis/zsxq/utils.js +72 -0
- package/dist/src/adapter-shadow.d.ts +11 -0
- package/dist/src/adapter-shadow.js +2 -0
- package/dist/src/adapter-shadow.test.d.ts +1 -0
- package/dist/src/adapter-source.d.ts +11 -0
- package/dist/src/adapter-source.js +1 -0
- package/dist/src/adapter-source.test.d.ts +1 -0
- package/dist/src/browser/analyze.d.ts +118 -0
- package/dist/src/browser/analyze.js +1 -0
- package/dist/src/browser/analyze.test.d.ts +1 -0
- package/dist/src/browser/article-extract.d.ts +57 -0
- package/dist/src/browser/article-extract.e2e.test.d.ts +1 -0
- package/dist/src/browser/article-extract.js +2 -0
- package/dist/src/browser/article-extract.test.d.ts +1 -0
- package/dist/src/browser/ax-snapshot.d.ts +37 -0
- package/dist/src/browser/ax-snapshot.js +2 -0
- package/dist/src/browser/ax-snapshot.test.d.ts +1 -0
- package/dist/src/browser/base-page.d.ts +151 -0
- package/dist/src/browser/base-page.js +225 -0
- package/dist/src/browser/base-page.test.d.ts +1 -0
- package/dist/src/browser/bridge-readiness.d.ts +14 -0
- package/dist/src/browser/bridge-readiness.js +1 -0
- package/dist/src/browser/bridge-readiness.test.d.ts +1 -0
- package/dist/src/browser/bridge.d.ts +26 -0
- package/dist/src/browser/bridge.js +1 -0
- package/dist/src/browser/cdp-click-fixture.test.d.ts +1 -0
- package/dist/src/browser/cdp.d.ts +51 -0
- package/dist/src/browser/cdp.js +1 -0
- package/dist/src/browser/cdp.test.d.ts +1 -0
- package/dist/src/browser/compound.d.ts +59 -0
- package/dist/src/browser/compound.js +82 -0
- package/dist/src/browser/compound.test.d.ts +1 -0
- package/dist/src/browser/config.d.ts +2 -0
- package/dist/src/browser/config.js +1 -0
- package/dist/src/browser/daemon-client.d.ts +79 -0
- package/dist/src/browser/daemon-client.js +1 -0
- package/dist/src/browser/daemon-client.test.d.ts +1 -0
- package/dist/src/browser/daemon-lifecycle.d.ts +37 -0
- package/dist/src/browser/daemon-lifecycle.js +12 -0
- package/dist/src/browser/daemon-transport.d.ts +55 -0
- package/dist/src/browser/daemon-transport.js +1 -0
- package/dist/src/browser/daemon-version.d.ts +4 -0
- package/dist/src/browser/daemon-version.js +2 -0
- package/dist/src/browser/dom-helpers.d.ts +41 -0
- package/dist/src/browser/dom-helpers.js +166 -0
- package/dist/src/browser/dom-helpers.test.d.ts +1 -0
- package/dist/src/browser/dom-snapshot.d.ts +93 -0
- package/dist/src/browser/dom-snapshot.js +809 -0
- package/dist/src/browser/dom-snapshot.test.d.ts +11 -0
- package/dist/src/browser/errors.d.ts +38 -0
- package/dist/src/browser/errors.js +5 -0
- package/dist/src/browser/errors.test.d.ts +1 -0
- package/dist/src/browser/extract.d.ts +69 -0
- package/dist/src/browser/extract.js +42 -0
- package/dist/src/browser/extract.test.d.ts +1 -0
- package/dist/src/browser/find.d.ts +84 -0
- package/dist/src/browser/find.js +328 -0
- package/dist/src/browser/find.test.d.ts +1 -0
- package/dist/src/browser/fingerprint.d.ts +44 -0
- package/dist/src/browser/fingerprint.js +82 -0
- package/dist/src/browser/html-tree.d.ts +75 -0
- package/dist/src/browser/html-tree.js +61 -0
- package/dist/src/browser/html-tree.test.d.ts +1 -0
- package/dist/src/browser/index.d.ts +14 -0
- package/dist/src/browser/index.js +1 -0
- package/dist/src/browser/managed-chrome.d.ts +89 -0
- package/dist/src/browser/managed-chrome.js +1 -0
- package/dist/src/browser/network-cache.d.ts +49 -0
- package/dist/src/browser/network-cache.js +1 -0
- package/dist/src/browser/network-cache.test.d.ts +1 -0
- package/dist/src/browser/network-key.d.ts +22 -0
- package/dist/src/browser/network-key.js +1 -0
- package/dist/src/browser/network-key.test.d.ts +1 -0
- package/dist/src/browser/page.d.ts +83 -0
- package/dist/src/browser/page.js +15 -0
- package/dist/src/browser/page.test.d.ts +1 -0
- package/dist/src/browser/profile.d.ts +96 -0
- package/dist/src/browser/profile.js +2 -0
- package/dist/src/browser/proxy-test.d.ts +28 -0
- package/dist/src/browser/proxy-test.js +12 -0
- package/dist/src/browser/shape-filter.d.ts +52 -0
- package/dist/src/browser/shape-filter.js +1 -0
- package/dist/src/browser/shape-filter.test.d.ts +1 -0
- package/dist/src/browser/shape.d.ts +23 -0
- package/dist/src/browser/shape.js +1 -0
- package/dist/src/browser/shape.test.d.ts +1 -0
- package/dist/src/browser/stealth.d.ts +18 -0
- package/dist/src/browser/stealth.js +391 -0
- package/dist/src/browser/stealth.test.d.ts +1 -0
- package/dist/src/browser/tabs.d.ts +13 -0
- package/dist/src/browser/tabs.js +2 -0
- package/dist/src/browser/target-errors.d.ts +39 -0
- package/dist/src/browser/target-errors.js +1 -0
- package/dist/src/browser/target-errors.test.d.ts +1 -0
- package/dist/src/browser/target-resolver.d.ts +158 -0
- package/dist/src/browser/target-resolver.js +423 -0
- package/dist/src/browser/target-resolver.test.d.ts +1 -0
- package/dist/src/browser/trace.d.ts +21 -0
- package/dist/src/browser/trace.js +2 -0
- package/dist/src/browser/utils.d.ts +20 -0
- package/dist/src/browser/utils.js +1 -0
- package/dist/src/browser/utils.test.d.ts +1 -0
- package/dist/src/browser/verify-fixture.d.ts +65 -0
- package/dist/src/browser/verify-fixture.js +2 -0
- package/dist/src/browser/verify-fixture.test.d.ts +1 -0
- package/dist/src/browser/visual-refs.d.ts +11 -0
- package/dist/src/browser/visual-refs.js +94 -0
- package/dist/src/browser-session-lock.d.ts +13 -0
- package/dist/src/browser-session-lock.js +1 -0
- package/dist/src/browser-session-lock.test.d.ts +1 -0
- package/dist/src/browser.test.d.ts +1 -0
- package/dist/src/build-manifest.d.ts +103 -0
- package/dist/src/build-manifest.js +16 -0
- package/dist/src/build-manifest.test.d.ts +1 -0
- package/dist/src/capabilityRouting.d.ts +19 -0
- package/dist/src/capabilityRouting.js +1 -0
- package/dist/src/capabilityRouting.test.d.ts +1 -0
- package/dist/src/cli-argv-preprocess.d.ts +63 -0
- package/dist/src/cli-argv-preprocess.js +1 -0
- package/dist/src/cli-argv-preprocess.test.d.ts +1 -0
- package/dist/src/cli.d.ts +79 -0
- package/dist/src/cli.js +132 -0
- package/dist/src/cli.test.d.ts +1 -0
- package/dist/src/commanderAdapter.d.ts +21 -0
- package/dist/src/commanderAdapter.js +3 -0
- package/dist/src/commanderAdapter.test.d.ts +1 -0
- package/dist/src/commands/auth.d.ts +40 -0
- package/dist/src/commands/auth.js +2 -0
- package/dist/src/commands/auth.test.d.ts +1 -0
- package/dist/src/commands/daemon.d.ts +25 -0
- package/dist/src/commands/daemon.js +1 -0
- package/dist/src/commands/daemon.test.d.ts +1 -0
- package/dist/src/completion-fast.d.ts +22 -0
- package/dist/src/completion-fast.js +1 -0
- package/dist/src/completion-shared.d.ts +13 -0
- package/dist/src/completion-shared.js +30 -0
- package/dist/src/completion.d.ts +21 -0
- package/dist/src/completion.js +1 -0
- package/dist/src/completion.test.d.ts +1 -0
- package/dist/src/constants.d.ts +22 -0
- package/dist/src/constants.js +1 -0
- package/dist/src/convention-audit.d.ts +50 -0
- package/dist/src/convention-audit.js +2 -0
- package/dist/src/convention-audit.test.d.ts +1 -0
- package/dist/src/daemon-utils.d.ts +18 -0
- package/dist/src/daemon-utils.js +1 -0
- package/dist/src/daemon.d.ts +22 -0
- package/dist/src/daemon.js +1 -0
- package/dist/src/daemon.test.d.ts +1 -0
- package/dist/src/discovery.d.ts +43 -0
- package/dist/src/discovery.js +2 -0
- package/dist/src/doctor.d.ts +38 -0
- package/dist/src/doctor.js +13 -0
- package/dist/src/doctor.test.d.ts +1 -0
- package/dist/src/download/article-download.d.ts +72 -0
- package/dist/src/download/article-download.js +21 -0
- package/dist/src/download/article-download.test.d.ts +1 -0
- package/dist/src/download/index.d.ts +71 -0
- package/dist/src/download/index.js +7 -0
- package/dist/src/download/index.test.d.ts +1 -0
- package/dist/src/download/media-download.d.ts +49 -0
- package/dist/src/download/media-download.js +1 -0
- package/dist/src/download/media-download.test.d.ts +1 -0
- package/dist/src/download/progress.d.ts +36 -0
- package/dist/src/download/progress.js +5 -0
- package/dist/src/download/progress.test.d.ts +1 -0
- package/dist/src/electron-apps.d.ts +31 -0
- package/dist/src/electron-apps.js +1 -0
- package/dist/src/electron-apps.test.d.ts +1 -0
- package/dist/src/engine.test.d.ts +1 -0
- package/dist/src/errors.d.ts +117 -0
- package/dist/src/errors.js +2 -0
- package/dist/src/errors.test.d.ts +1 -0
- package/dist/src/execution.d.ts +24 -0
- package/dist/src/execution.js +2 -0
- package/dist/src/execution.test.d.ts +1 -0
- package/dist/src/extension-manifest-regression.test.d.ts +1 -0
- package/dist/src/external-clis.yaml +109 -0
- package/dist/src/external.d.ts +49 -0
- package/dist/src/external.js +1 -0
- package/dist/src/external.test.d.ts +1 -0
- package/dist/src/help.d.ts +88 -0
- package/dist/src/help.js +8 -0
- package/dist/src/help.test.d.ts +1 -0
- package/dist/src/hooks.d.ts +46 -0
- package/dist/src/hooks.js +1 -0
- package/dist/src/hooks.test.d.ts +4 -0
- package/dist/src/interceptor.d.ts +44 -0
- package/dist/src/interceptor.js +123 -0
- package/dist/src/interceptor.test.d.ts +4 -0
- package/dist/src/launcher.d.ts +41 -0
- package/dist/src/launcher.js +7 -0
- package/dist/src/launcher.test.d.ts +1 -0
- package/dist/src/logger.d.ts +26 -0
- package/dist/src/logger.js +9 -0
- package/dist/src/main.d.ts +5 -0
- package/dist/src/main.js +10 -0
- package/dist/src/manifest-types.d.ts +43 -0
- package/dist/src/manifest-types.js +1 -0
- package/dist/src/node-network.d.ts +10 -0
- package/dist/src/node-network.js +1 -0
- package/dist/src/node-network.test.d.ts +1 -0
- package/dist/src/observation/artifact.d.ts +16 -0
- package/dist/src/observation/artifact.js +8 -0
- package/dist/src/observation/artifact.test.d.ts +1 -0
- package/dist/src/observation/events.d.ts +89 -0
- package/dist/src/observation/events.js +1 -0
- package/dist/src/observation/index.d.ts +7 -0
- package/dist/src/observation/index.js +1 -0
- package/dist/src/observation/manager.d.ts +9 -0
- package/dist/src/observation/manager.js +1 -0
- package/dist/src/observation/manager.test.d.ts +1 -0
- package/dist/src/observation/redaction.d.ts +11 -0
- package/dist/src/observation/redaction.js +2 -0
- package/dist/src/observation/redaction.test.d.ts +1 -0
- package/dist/src/observation/retention.d.ts +32 -0
- package/dist/src/observation/retention.js +1 -0
- package/dist/src/observation/retention.test.d.ts +1 -0
- package/dist/src/observation/ring-buffer.d.ts +22 -0
- package/dist/src/observation/ring-buffer.js +1 -0
- package/dist/src/observation/ring-buffer.test.d.ts +1 -0
- package/dist/src/observation/session.d.ts +25 -0
- package/dist/src/observation/session.js +1 -0
- package/dist/src/output.d.ts +14 -0
- package/dist/src/output.js +2 -0
- package/dist/src/output.test.d.ts +1 -0
- package/dist/src/package-exports.test.d.ts +1 -0
- package/dist/src/package-paths.d.ts +8 -0
- package/dist/src/package-paths.js +1 -0
- package/dist/src/pipeline/executor.d.ts +11 -0
- package/dist/src/pipeline/executor.js +1 -0
- package/dist/src/pipeline/executor.test.d.ts +4 -0
- package/dist/src/pipeline/index.d.ts +5 -0
- package/dist/src/pipeline/index.js +1 -0
- package/dist/src/pipeline/registry.d.ts +28 -0
- package/dist/src/pipeline/registry.js +1 -0
- package/dist/src/pipeline/steps/browser.d.ts +13 -0
- package/dist/src/pipeline/steps/browser.js +1 -0
- package/dist/src/pipeline/steps/download.d.ts +18 -0
- package/dist/src/pipeline/steps/download.js +1 -0
- package/dist/src/pipeline/steps/download.test.d.ts +1 -0
- package/dist/src/pipeline/steps/fetch.d.ts +5 -0
- package/dist/src/pipeline/steps/fetch.js +31 -0
- package/dist/src/pipeline/steps/fetch.test.d.ts +1 -0
- package/dist/src/pipeline/steps/intercept.d.ts +5 -0
- package/dist/src/pipeline/steps/intercept.js +1 -0
- package/dist/src/pipeline/steps/tap.d.ts +12 -0
- package/dist/src/pipeline/steps/tap.js +53 -0
- package/dist/src/pipeline/steps/transform.d.ts +9 -0
- package/dist/src/pipeline/steps/transform.js +1 -0
- package/dist/src/pipeline/template.d.ts +17 -0
- package/dist/src/pipeline/template.js +1 -0
- package/dist/src/pipeline/template.test.d.ts +4 -0
- package/dist/src/pipeline/transform.test.d.ts +4 -0
- package/dist/src/plugin-manifest.d.ts +70 -0
- package/dist/src/plugin-manifest.js +1 -0
- package/dist/src/plugin-manifest.test.d.ts +4 -0
- package/dist/src/plugin-scaffold.d.ts +28 -0
- package/dist/src/plugin-scaffold.js +75 -0
- package/dist/src/plugin-scaffold.test.d.ts +4 -0
- package/dist/src/plugin.d.ts +145 -0
- package/dist/src/plugin.js +20 -0
- package/dist/src/plugin.test.d.ts +4 -0
- package/dist/src/rate-limit.d.ts +15 -0
- package/dist/src/rate-limit.js +2 -0
- package/dist/src/rate-limit.test.d.ts +1 -0
- package/dist/src/registry-api.d.ts +13 -0
- package/dist/src/registry-api.js +1 -0
- package/dist/src/registry.d.ts +130 -0
- package/dist/src/registry.js +1 -0
- package/dist/src/registry.test.d.ts +4 -0
- package/dist/src/runtime-detect.d.ts +31 -0
- package/dist/src/runtime-detect.js +1 -0
- package/dist/src/runtime-detect.test.d.ts +1 -0
- package/dist/src/runtime.d.ts +57 -0
- package/dist/src/runtime.js +1 -0
- package/dist/src/scripts/framework.d.ts +7 -0
- package/dist/src/scripts/framework.js +1 -0
- package/dist/src/scripts/interact.d.ts +4 -0
- package/dist/src/scripts/interact.js +1 -0
- package/dist/src/scripts/store.d.ts +13 -0
- package/dist/src/scripts/store.js +1 -0
- package/dist/src/serialization.d.ts +42 -0
- package/dist/src/serialization.js +4 -0
- package/dist/src/serialization.test.d.ts +1 -0
- package/dist/src/skills.d.ts +14 -0
- package/dist/src/skills.js +6 -0
- package/dist/src/skills.test.d.ts +1 -0
- package/dist/src/snapshotFormatter.d.ts +11 -0
- package/dist/src/snapshotFormatter.js +3 -0
- package/dist/src/snapshotFormatter.test.d.ts +7 -0
- package/dist/src/tui.d.ts +28 -0
- package/dist/src/tui.js +16 -0
- package/dist/src/tui.test.d.ts +1 -0
- package/dist/src/types.d.ts +236 -0
- package/dist/src/types.js +1 -0
- package/dist/src/utils.d.ts +57 -0
- package/dist/src/utils.js +38 -0
- package/dist/src/utils.test.d.ts +1 -0
- package/dist/src/validate.d.ts +21 -0
- package/dist/src/validate.js +3 -0
- package/dist/src/validate.test.d.ts +9 -0
- package/dist/src/verify.d.ts +27 -0
- package/dist/src/verify.js +2 -0
- package/dist/src/verify.test.d.ts +8 -0
- package/dist/src/version.d.ts +4 -0
- package/dist/src/version.js +1 -0
- package/dist/src/weixin-download.test.d.ts +1 -0
- package/docs/guide/browser-bridge.md +94 -0
- package/docs/guide/electron-app-cli.md +199 -0
- package/docs/guide/exit-codes.md +24 -0
- package/docs/guide/extending-opencli.md +134 -0
- package/docs/guide/getting-started.md +81 -0
- package/docs/guide/installation.md +52 -0
- package/docs/guide/plugins.md +226 -0
- package/docs/guide/remote-orchestration.md +116 -0
- package/docs/guide/troubleshooting.md +69 -0
- package/package.json +116 -0
- package/scripts/check-doc-coverage.sh +81 -0
- package/scripts/check-listing-id-pairing.mjs +193 -0
- package/scripts/check-silent-column-drop.mjs +105 -0
- package/scripts/check-typed-error-lint.mjs +118 -0
- package/scripts/clean-dist.cjs +13 -0
- package/scripts/copy-yaml.cjs +12 -0
- package/scripts/fetch-adapters.js +293 -0
- package/scripts/minify-release.mjs +115 -0
- package/scripts/postinstall.js +174 -0
- package/scripts/silent-column-drop-baseline.json +910 -0
- package/scripts/typed-error-lint-baseline.json +1098 -0
- package/skills/opencli-adapter-author/SKILL.md +256 -0
- package/skills/opencli-adapter-author/references/adapter-template.md +471 -0
- package/skills/opencli-adapter-author/references/api-discovery.md +295 -0
- package/skills/opencli-adapter-author/references/coverage-matrix.md +81 -0
- package/skills/opencli-adapter-author/references/field-conventions.md +172 -0
- package/skills/opencli-adapter-author/references/field-decode-playbook.md +181 -0
- package/skills/opencli-adapter-author/references/jsdom-fixture-pattern.md +196 -0
- package/skills/opencli-adapter-author/references/output-design.md +149 -0
- package/skills/opencli-adapter-author/references/site-memory/bilibili.md +70 -0
- package/skills/opencli-adapter-author/references/site-memory/eastmoney.md +70 -0
- package/skills/opencli-adapter-author/references/site-memory/tonghuashun.md +51 -0
- package/skills/opencli-adapter-author/references/site-memory/xueqiu.md +58 -0
- package/skills/opencli-adapter-author/references/site-memory.md +231 -0
- package/skills/opencli-adapter-author/references/site-recon.md +134 -0
- package/skills/opencli-adapter-author/references/strategy-selection.md +169 -0
- package/skills/opencli-adapter-author/references/success-rate-pitfalls.md +162 -0
- package/skills/opencli-adapter-author/references/typed-errors.md +234 -0
- package/skills/opencli-autofix/SKILL.md +297 -0
- package/skills/opencli-browser/SKILL.md +468 -0
- package/skills/opencli-browser-sitemap/SKILL.md +96 -0
- package/skills/opencli-sitemap-author/SKILL.md +161 -0
- package/skills/opencli-sitemap-author/references/sitemap-schema.md +660 -0
- package/skills/opencli-usage/SKILL.md +168 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import{cli as q,Strategy as v}from"@jackwener/opencli/registry";import{downloadArticle as x}from"@jackwener/opencli/download/article-download";q({site:"zhihu",name:"download",access:"read",description:"导出知乎文章为 Markdown 格式",domain:"zhuanlan.zhihu.com",strategy:v.COOKIE,args:[{name:"url",required:!0,help:"Article URL (zhuanlan.zhihu.com/p/xxx)"},{name:"output",default:"./zhihu-articles",help:"Output directory"},{name:"download-images",type:"boolean",default:!1,help:"Download images locally"}],columns:["title","author","publish_time","status","size"],func:async(f,h)=>{const m=h.url;await f.goto(m);await f.wait(3);const b=await f.evaluate(`
|
|
2
|
+
(() => {
|
|
3
|
+
const result = {
|
|
4
|
+
title: '',
|
|
5
|
+
author: '',
|
|
6
|
+
publishTime: '',
|
|
7
|
+
contentHtml: '',
|
|
8
|
+
imageUrls: []
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// Get title
|
|
12
|
+
const titleEl = document.querySelector('.Post-Title, h1.ContentItem-title, .ArticleTitle');
|
|
13
|
+
result.title = titleEl?.textContent?.trim() || 'untitled';
|
|
14
|
+
|
|
15
|
+
// Get author
|
|
16
|
+
const authorEl = document.querySelector('.AuthorInfo-name, .UserLink-link');
|
|
17
|
+
result.author = authorEl?.textContent?.trim() || '';
|
|
18
|
+
|
|
19
|
+
// Get publish time
|
|
20
|
+
const timeEl = document.querySelector('.ContentItem-time, .Post-Time');
|
|
21
|
+
result.publishTime = timeEl?.textContent?.trim() || '';
|
|
22
|
+
|
|
23
|
+
// Get content HTML
|
|
24
|
+
const contentEl = document.querySelector('.Post-RichTextContainer, .RichText, .ArticleContent');
|
|
25
|
+
if (contentEl) {
|
|
26
|
+
result.contentHtml = contentEl.innerHTML;
|
|
27
|
+
|
|
28
|
+
// Extract image URLs
|
|
29
|
+
contentEl.querySelectorAll('img').forEach(img => {
|
|
30
|
+
const src = img.getAttribute('data-original') || img.getAttribute('data-actualsrc') || img.src;
|
|
31
|
+
if (src && !src.includes('data:image')) {
|
|
32
|
+
result.imageUrls.push(src);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return result;
|
|
38
|
+
})()
|
|
39
|
+
`);return x({title:b?.title||"",author:b?.author,publishTime:b?.publishTime,sourceUrl:m,contentHtml:b?.contentHtml||"",imageUrls:b?.imageUrls},{output:h.output,downloadImages:h["download-images"],imageHeaders:{Referer:"https://zhuanlan.zhihu.com/"}})}});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import{CliError as n,CommandExecutionError as c}from"@jackwener/opencli/errors";import{cli as s,Strategy as m}from"@jackwener/opencli/registry";import{assertAllowedKinds as d,parseTarget as u}from"./target.js";import{buildResultRow as p,requireExecute as f}from"./write-shared.js";function y(e){return e.replace(/\s+/g," ").replace(/\s+\d+\s*(条内容|个内容|items?)$/i,"").replace(/\s+(公开|私密|默认)$/i,"").trim()}s({site:"zhihu",name:"favorite",access:"write",description:"Favorite a Zhihu answer or article into a specific collection",domain:"zhihu.com",strategy:m.COOKIE,browser:!0,args:[{name:"target",positional:!0,required:!0,help:"Zhihu target URL or typed target"},{name:"collection",help:"Collection name"},{name:"collection-id",help:"Stable collection id"},{name:"execute",type:"boolean",help:"Actually perform the write action"}],columns:["status","outcome","message","target_type","target","collection_name","collection_id"],func:async(e,t)=>{if(!e)throw new c("Browser session required for zhihu favorite");f(t);const r=String(t.target),i=d("favorite",u(r)),o=typeof t.collection==="string"?t.collection:void 0,a=typeof t["collection-id"]==="string"?t["collection-id"]:void 0;if((o?1:0)+(a?1:0)!==1)throw new n("INVALID_INPUT","Use exactly one of --collection or --collection-id");await e.goto("https://www.zhihu.com");await e.wait(2);const l=await e.evaluate(`(async () => {
|
|
2
|
+
var collectionId = ${JSON.stringify(a||null)};
|
|
3
|
+
var collectionName = ${JSON.stringify(o||null)};
|
|
4
|
+
var targetKind = ${JSON.stringify(i.kind)};
|
|
5
|
+
var targetId = ${JSON.stringify(i.id)};
|
|
6
|
+
var normalizeCollectionName = function(value) {
|
|
7
|
+
return String(value || '')
|
|
8
|
+
.replace(/\\s+/g, ' ')
|
|
9
|
+
.replace(/\\s+\\d+\\s*(条内容|个内容|items?)$/i, '')
|
|
10
|
+
.replace(/\\s+(公开|私密|默认)$/i, '')
|
|
11
|
+
.trim()
|
|
12
|
+
.toLowerCase();
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
if (!collectionId && collectionName) {
|
|
16
|
+
var listResp = await fetch('https://www.zhihu.com/api/v4/people/self/collections?limit=50', { credentials: 'include' });
|
|
17
|
+
if (!listResp.ok) return { ok: false, message: 'Failed to list collections: HTTP ' + listResp.status };
|
|
18
|
+
var listData = {};
|
|
19
|
+
try { listData = await listResp.json(); } catch(e) {
|
|
20
|
+
return { ok: false, message: 'Failed to parse collection list' };
|
|
21
|
+
}
|
|
22
|
+
var needle = normalizeCollectionName(collectionName);
|
|
23
|
+
var matches = (listData.data || []).filter(function(c) { return normalizeCollectionName(c.title) === needle; });
|
|
24
|
+
if (matches.length === 0) return { ok: false, message: 'Collection not found: ' + collectionName };
|
|
25
|
+
if (matches.length > 1) return { ok: false, message: 'Collection name is ambiguous: ' + collectionName };
|
|
26
|
+
collectionId = String(matches[0].id);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var resp = await fetch('https://www.zhihu.com/api/v4/favlists/' + collectionId + '/items', {
|
|
30
|
+
method: 'POST',
|
|
31
|
+
credentials: 'include',
|
|
32
|
+
headers: { 'Content-Type': 'application/json' },
|
|
33
|
+
body: JSON.stringify({ item_id: targetId, item_type: targetKind }),
|
|
34
|
+
});
|
|
35
|
+
if (resp.ok || resp.status === 204) return { ok: true, collectionId: collectionId };
|
|
36
|
+
var data = {};
|
|
37
|
+
try { data = await resp.json(); } catch(e) {}
|
|
38
|
+
return { ok: false, message: data.error ? data.error.message : 'HTTP ' + resp.status };
|
|
39
|
+
})()`);if(!l?.ok)throw new n("COMMAND_EXEC",l?.message||"Failed to favorite");return p(`Favorited ${i.kind} ${i.id}`,i.kind,r,"applied",{collection_name:o||"",collection_id:l.collectionId||a||""})}});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{CliError as i,CommandExecutionError as s}from"@jackwener/opencli/errors";import{cli as u,Strategy as l}from"@jackwener/opencli/registry";import{assertAllowedKinds as n,parseTarget as w}from"./target.js";import{buildResultRow as d,requireExecute as m}from"./write-shared.js";u({site:"zhihu",name:"follow",access:"write",description:"Follow a Zhihu user or question",domain:"www.zhihu.com",strategy:l.COOKIE,browser:!0,args:[{name:"target",positional:!0,required:!0,help:"Zhihu target URL or typed target"},{name:"execute",type:"boolean",help:"Actually perform the write action"}],columns:["status","outcome","message","target_type","target"],func:async(t,r)=>{if(!t)throw new s("Browser session required for zhihu follow");m(r);const a=String(r.target),e=n("follow",w(a));await t.goto("https://www.zhihu.com");await t.wait(2);const o=await t.evaluate(`(async () => {
|
|
2
|
+
var targetKind = ${JSON.stringify(e.kind)};
|
|
3
|
+
var targetId = ${JSON.stringify(e.kind==="user"?e.slug:e.id)};
|
|
4
|
+
var url;
|
|
5
|
+
if (targetKind === 'question') {
|
|
6
|
+
url = 'https://www.zhihu.com/api/v4/questions/' + targetId + '/followers';
|
|
7
|
+
} else if (targetKind === 'user') {
|
|
8
|
+
url = 'https://www.zhihu.com/api/v4/members/' + targetId + '/followers';
|
|
9
|
+
} else {
|
|
10
|
+
return { ok: false, message: 'unsupported target type: ' + targetKind };
|
|
11
|
+
}
|
|
12
|
+
var resp = await fetch(url, { method: 'POST', credentials: 'include' });
|
|
13
|
+
if (!resp.ok) {
|
|
14
|
+
var data = {};
|
|
15
|
+
try { data = await resp.json(); } catch(e) {}
|
|
16
|
+
return { ok: false, message: data.error ? data.error.message : 'HTTP ' + resp.status };
|
|
17
|
+
}
|
|
18
|
+
return { ok: true };
|
|
19
|
+
})()`);if(!o?.ok)throw new i("COMMAND_EXEC",o?.message||"Failed to follow");return d(`Followed ${e.kind} ${e.kind==="user"?e.slug:e.id}`,e.kind,a,"applied")}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as m,Strategy as s}from"@jackwener/opencli/registry";import{CommandExecutionError as a}from"@jackwener/opencli/errors";import{parseZhihuUser as u}from"./user-arg.js";import{fetchZhihuList as h,validateLimit as c}from"./paginate.js";const w="data[*].follower_count,headline,answer_count,articles_count";m({site:"zhihu",name:"followers",access:"read",description:"知乎某用户的粉丝列表",domain:"www.zhihu.com",strategy:s.COOKIE,args:[{name:"user",type:"string",required:!0,positional:!0,help:"User url_token or people URL"},{name:"limit",type:"int",default:20,help:"Number of followers to return (max 1000)"}],columns:["rank","name","url_token","headline","followers","url"],func:async(o,t)=>{const r=u(t.user),n=c(t.limit);await o.goto("https://www.zhihu.com");const i=`https://www.zhihu.com/api/v4/members/${encodeURIComponent(r)}/followers?limit=20&offset=0&include=${encodeURIComponent(w)}`;return(await h(o,i,n,"followers")).map((e,l)=>{if(!e.url_token||!e.name)throw new a("Zhihu followers returned malformed row identity");return{rank:l+1,name:String(e.name||""),url_token:String(e.url_token||""),headline:String(e.headline||""),followers:e.follower_count??0,url:`https://www.zhihu.com/people/${e.url_token}`}})}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as m,Strategy as a}from"@jackwener/opencli/registry";import{CommandExecutionError as s}from"@jackwener/opencli/errors";import{parseZhihuUser as u}from"./user-arg.js";import{fetchZhihuList as h,validateLimit as c}from"./paginate.js";const w="data[*].follower_count,headline,answer_count,articles_count";m({site:"zhihu",name:"following",access:"read",description:"知乎某用户关注的人列表",domain:"www.zhihu.com",strategy:a.COOKIE,args:[{name:"user",type:"string",required:!0,positional:!0,help:"User url_token or people URL"},{name:"limit",type:"int",default:20,help:"Number of followees to return (max 1000)"}],columns:["rank","name","url_token","headline","followers","url"],func:async(o,t)=>{const r=u(t.user),n=c(t.limit);await o.goto("https://www.zhihu.com");const i=`https://www.zhihu.com/api/v4/members/${encodeURIComponent(r)}/followees?limit=20&offset=0&include=${encodeURIComponent(w)}`;return(await h(o,i,n,"following")).map((e,l)=>{if(!e.url_token||!e.name)throw new s("Zhihu following returned malformed row identity");return{rank:l+1,name:String(e.name||""),url_token:String(e.url_token||""),headline:String(e.headline||""),followers:e.follower_count??0,url:`https://www.zhihu.com/people/${e.url_token}`}})}});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{cli as t}from"@jackwener/opencli/registry";t({site:"zhihu",name:"hot",access:"read",description:"知乎热榜",domain:"www.zhihu.com",args:[{name:"limit",type:"int",default:20,help:"Number of items to return"}],columns:["rank","title","heat","answers"],pipeline:[{navigate:"https://www.zhihu.com"},{evaluate:`(async () => {
|
|
2
|
+
const res = await fetch('https://www.zhihu.com/api/v3/feed/topstory/hot-lists/total?limit=50', {
|
|
3
|
+
credentials: 'include'
|
|
4
|
+
});
|
|
5
|
+
const text = await res.text();
|
|
6
|
+
const d = JSON.parse(
|
|
7
|
+
text.replace(/("id"\\s*:\\s*)(\\d{16,})/g, '$1"$2"')
|
|
8
|
+
);
|
|
9
|
+
return (d?.data || []).map((item) => {
|
|
10
|
+
const t = item.target || {};
|
|
11
|
+
const questionId = t.id == null ? '' : String(t.id);
|
|
12
|
+
return {
|
|
13
|
+
title: t.title,
|
|
14
|
+
url: 'https://www.zhihu.com/question/' + questionId,
|
|
15
|
+
answer_count: t.answer_count,
|
|
16
|
+
follower_count: t.follower_count,
|
|
17
|
+
heat: item.detail_text || '',
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
})()
|
|
21
|
+
`},{map:{rank:"${{ index + 1 }}",title:"${{ item.title }}",heat:"${{ item.heat }}",answers:"${{ item.answer_count }}",url:"${{ item.url }}"}},{limit:"${{ args.limit }}"}]});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{CliError as s,CommandExecutionError as o}from"@jackwener/opencli/errors";import{cli as n,Strategy as u}from"@jackwener/opencli/registry";import{assertAllowedKinds as c,parseTarget as d}from"./target.js";import{buildResultRow as l,requireExecute as p}from"./write-shared.js";n({site:"zhihu",name:"like",access:"write",description:"Like a Zhihu answer or article",domain:"zhihu.com",strategy:u.COOKIE,browser:!0,args:[{name:"target",positional:!0,required:!0,help:"Zhihu target URL or typed target"},{name:"execute",type:"boolean",help:"Actually perform the write action"}],columns:["status","outcome","message","target_type","target"],func:async(r,t)=>{if(!r)throw new o("Browser session required for zhihu like");p(t);const a=String(t.target),e=c("like",d(a));await r.goto("https://www.zhihu.com");await r.wait(2);const i=await r.evaluate(`(async () => {
|
|
2
|
+
var targetKind = ${JSON.stringify(e.kind)};
|
|
3
|
+
var targetId = ${JSON.stringify(e.id)};
|
|
4
|
+
var resourceType = targetKind === 'answer' ? 'answers' : 'articles';
|
|
5
|
+
var url = 'https://www.zhihu.com/api/v4/' + resourceType + '/' + targetId + '/voters';
|
|
6
|
+
var resp = await fetch(url, {
|
|
7
|
+
method: 'POST',
|
|
8
|
+
credentials: 'include',
|
|
9
|
+
headers: { 'Content-Type': 'application/json' },
|
|
10
|
+
body: JSON.stringify({ type: 'up' }),
|
|
11
|
+
});
|
|
12
|
+
var data = await resp.json();
|
|
13
|
+
if (!resp.ok) return { ok: false, message: data.error ? data.error.message : 'unknown error' };
|
|
14
|
+
if (data && data.success === false) return { ok: false, message: 'Zhihu like API reported success=false' };
|
|
15
|
+
return { ok: true, success: data.success };
|
|
16
|
+
})()`);if(!i?.ok)throw new s("COMMAND_EXEC",i?.message||"Failed to like");return l(`Liked ${e.kind} ${e.id}`,e.kind,a,"applied")}});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{ArgumentError as V,AuthRequiredError as F,CommandExecutionError as K,EmptyResultError as W}from"@jackwener/opencli/errors";export const MAX_LIMIT=1000;export function validateLimit(G,B=20){const J=G??B;let D;if(typeof J==="number")D=J;else{const H=String(J).trim();if(!/^\d+$/.test(H))throw new V(`--limit must be a positive integer no greater than ${MAX_LIMIT}`,"Use a normal-sized decimal integer limit to avoid slow requests or Zhihu risk controls");D=Number(H)}if(!Number.isInteger(D)||D<=0||D>MAX_LIMIT)throw new V(`--limit must be a positive integer no greater than ${MAX_LIMIT}`,"Use a normal-sized decimal integer limit to avoid slow requests or Zhihu risk controls");return D}export function unwrapEvaluateResult(G){if(G&&typeof G==="object"&&"data"in G&&"session"in G)return G.data;return G}export function requireZhihuListPayload(G,B,J){const D=unwrapEvaluateResult(G);if(!D||typeof D!=="object"||Array.isArray(D))throw new K(`Zhihu ${B} returned malformed payload`,`URL: ${J}`);if(D.__httpError){const H=D.__httpError;if(H===401||H===403)throw new F("www.zhihu.com",`Failed to fetch Zhihu ${B}`);if(H===404)throw new W(`zhihu ${B}`,"Check the target identifier");throw new K(`Zhihu ${B} request failed${H?` (HTTP ${H})`:""}`,"Try again later or rerun with -v")}if(D.__fetchError)throw new K(`Zhihu ${B} request failed`,String(D.__fetchError));if(!Array.isArray(D.data))throw new K(`Zhihu ${B} returned malformed data list`,`URL: ${J}`);if(!D.paging||typeof D.paging!=="object")throw new K(`Zhihu ${B} returned malformed paging data`,`URL: ${J}`);return D}function Y(G){if(typeof G!=="string"||!G)return"";try{const B=new URL(G);if(B.protocol!=="https:")return"";if(B.hostname==="api.zhihu.com"&&B.pathname.startsWith("/members/"))return`https://www.zhihu.com/api/v4${B.pathname}${B.search}`;if(B.hostname==="www.zhihu.com"&&B.pathname.startsWith("/api/v4/members/"))return B.toString()}catch{return""}return""}function $(G,B){try{return new URL(G).pathname===new URL(B).pathname}catch{return!1}}export async function fetchZhihuList(G,B,J,D){const H=[],Q=new Set;let N=B;while(N&&H.length<J&&!Q.has(N)){Q.add(N);const S=requireZhihuListPayload(await G.evaluate(`
|
|
2
|
+
(async () => {
|
|
3
|
+
try {
|
|
4
|
+
const r = await fetch(${JSON.stringify(N)}, { credentials: 'include' });
|
|
5
|
+
if (!r.ok) return { __httpError: r.status };
|
|
6
|
+
return await r.json();
|
|
7
|
+
} catch (err) {
|
|
8
|
+
return { __fetchError: err?.message || String(err) };
|
|
9
|
+
}
|
|
10
|
+
})()
|
|
11
|
+
`),D,N);for(const j of S.data){H.push(j);if(H.length>=J)break}if(S.paging?.is_end)break;const O=Y(S.paging?.next);if(!O||!$(O,B))throw new K(`Zhihu ${D} pagination returned malformed next URL`);if(Q.has(O))throw new K(`Zhihu ${D} pagination returned a repeated next URL`);N=O}if(H.length===0)throw new W(`zhihu ${D}`,"No rows were returned for the requested Zhihu user.");return H}export const __test__={normalizeZhihuApiUrl:Y,sameZhihuApiPath:$};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{CliError as J,CommandExecutionError as K}from"@jackwener/opencli/errors";import{cli as N,Strategy as O}from"@jackwener/opencli/registry";import{buildResultRow as Q,requireExecute as V,resolveCurrentUserIdentity as W,resolvePayload as X}from"./write-shared.js";N({site:"zhihu",name:"pin",access:"write",description:"Publish a Zhihu pin (想法/short post)",domain:"www.zhihu.com",strategy:O.COOKIE,browser:!0,args:[{name:"text",positional:!0,help:"Pin text content"},{name:"file",help:"Pin text file path (UTF-8)"},{name:"execute",type:"boolean",help:"Actually publish the pin. Without it the command refuses to write."}],columns:["status","outcome","message","target_type","target","created_target","created_url","author_identity"],func:async(f,A)=>{if(!f)throw new K("Browser session required for zhihu pin");V(A);const D=await X(A);await f.goto("https://www.zhihu.com");await f.wait(3);let B="";try{B=await W(f)}catch{}const F=D.split(`
|
|
2
|
+
`).map((G)=>`<p>${Y(G)}</p>`).join(""),z=await f.evaluate(`(async () => {
|
|
3
|
+
var html = ${JSON.stringify(F)};
|
|
4
|
+
var xsrf = (document.cookie.match(/_xsrf=([^;]+)/) || [])[1] || '';
|
|
5
|
+
var body = new URLSearchParams();
|
|
6
|
+
body.set('content', JSON.stringify([{ type: 'text', content: html }]));
|
|
7
|
+
body.set('reaction_instruction', JSON.stringify({}));
|
|
8
|
+
var resp = await fetch('https://www.zhihu.com/api/v4/pins', {
|
|
9
|
+
method: 'POST',
|
|
10
|
+
credentials: 'include',
|
|
11
|
+
headers: {
|
|
12
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
13
|
+
'x-requested-with': 'fetch',
|
|
14
|
+
'x-xsrftoken': xsrf,
|
|
15
|
+
},
|
|
16
|
+
body: body.toString(),
|
|
17
|
+
});
|
|
18
|
+
var text = await resp.text();
|
|
19
|
+
var data;
|
|
20
|
+
try { data = JSON.parse(text); } catch (e) { data = null; }
|
|
21
|
+
if (!resp.ok) return { ok: false, status: resp.status, message: (data && data.error && data.error.message) || text.slice(0, 300) };
|
|
22
|
+
if (!data || !data.id) return { ok: false, status: resp.status, message: 'Pin API response did not include a created pin id: ' + text.slice(0, 300) };
|
|
23
|
+
return { ok: true, id: String(data.id), url: data.url || ('https://www.zhihu.com/pin/' + data.id) };
|
|
24
|
+
})()`);if(!z?.ok)throw new J("COMMAND_EXEC",z?.message||"Failed to publish pin");return Q("Published pin","pin","","created",{created_target:"pin:"+z.id,created_url:z.url,author_identity:B})}});function Y(f){return String(f).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as c,Strategy as u}from"@jackwener/opencli/registry";import{CommandExecutionError as a}from"@jackwener/opencli/errors";import{parseZhihuUser as l}from"./user-arg.js";import{fetchZhihuList as p,validateLimit as h}from"./paginate.js";c({site:"zhihu",name:"pins",access:"read",description:"知乎某用户的想法(短内容)列表",domain:"www.zhihu.com",strategy:u.COOKIE,args:[{name:"user",type:"string",required:!0,positional:!0,help:"User url_token or people URL"},{name:"limit",type:"int",default:20,help:"Number of pins to return (max 1000)"}],columns:["rank","excerpt","type","likes","comments","reposts","created","url"],func:async(e,i)=>{const r=l(i.user),n=h(i.limit);await e.goto("https://www.zhihu.com");const o=`https://www.zhihu.com/api/v4/members/${encodeURIComponent(r)}/pins?limit=20&offset=0`;return(await p(e,o,n,"pins")).map((t,s)=>{const m=Array.isArray(t.content)?t.content[0]:null;if(!t.id||!t.excerpt_title)throw new a("Zhihu pins returned malformed row identity");return{rank:s+1,excerpt:String(t.excerpt_title||""),type:String(m?.type||""),likes:t.like_count??t.reaction_count??0,comments:t.comment_count??0,reposts:t.repin_count??0,created:t.created??t.updated??0,url:`https://www.zhihu.com/pin/${t.id}`}})}});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{cli as H,Strategy as K}from"@jackwener/opencli/registry";import{AuthRequiredError as R,CliError as W}from"@jackwener/opencli/errors";import{stripHtml as S}from"./text.js";function f(b){if(typeof b!=="string")return"";try{const z=new URL(b);if(z.hostname!=="www.zhihu.com"&&z.hostname!=="zhihu.com")return"";return z.pathname.match(/^\/question\/\d+\/answer\/(\d+)\/?$/)?.[1]||z.pathname.match(/^\/api\/v4\/answers\/(\d+)\/?$/)?.[1]||z.pathname.match(/^\/answer\/(\d+)\/?$/)?.[1]||""}catch{return""}}function $(b){const z=f(b.url);if(z)return z;if(typeof b.id==="string"&&/^\d+$/.test(b.id))return b.id;if(typeof b.id==="number"&&Number.isSafeInteger(b.id)&&b.id>0)return String(b.id);return""}function h(b){const z=$(b);if(z)return`id:${z}`;return`fallback:${b.author?.name||"anonymous"}:${b.content||""}`}const x=1000;H({site:"zhihu",name:"question",access:"read",description:"知乎问题详情和回答",domain:"www.zhihu.com",strategy:K.COOKIE,args:[{name:"id",required:!0,positional:!0,help:"Question ID (numeric)"},{name:"limit",type:"int",default:5,help:"Number of answers (max 1000; use normal-sized requests)"},{name:"sort",default:"default",choices:["default","created"],help:"Answer order: default or created"}],columns:["rank","id","author","votes","url","content"],func:async(b,z)=>{const{id:D,limit:F=5}=z,N=String(D);if(!/^\d+$/.test(N))throw new W("INVALID_INPUT","Question ID must be numeric","Example: opencli zhihu question 123456789");const O=Number(F);if(!Number.isInteger(O)||O<=0||O>x)throw new W("INVALID_INPUT",`Limit must be a positive integer no greater than ${x}`,"Use a normal-sized limit to avoid slow requests or Zhihu risk controls");const Q=String(z.sort||"default");if(Q!=="default"&&Q!=="created")throw new W("INVALID_INPUT","Sort must be one of: default, created","Example: opencli zhihu question 123456789 --sort created");await b.goto(Q==="created"?`https://www.zhihu.com/question/${N}/answers/updated`:`https://www.zhihu.com/question/${N}`);let P=`https://www.zhihu.com/api/v4/questions/${N}/answers?limit=${20}&offset=0&sort_by=${Q}&include=data[*].content,url,voteup_count,comment_count,author`;const V=[],Y=new Set,Z=new Set;while(P&&V.length<O&&!Z.has(P)){Z.add(P);const B=await b.evaluate(`
|
|
2
|
+
(async () => {
|
|
3
|
+
const r = await fetch(${JSON.stringify(P)}, { credentials: 'include' });
|
|
4
|
+
if (!r.ok) return { __httpError: r.status };
|
|
5
|
+
return await r.json();
|
|
6
|
+
})()
|
|
7
|
+
`);if(!B||B.__httpError){const G=B?.__httpError;if(G===401||G===403)throw new R("www.zhihu.com","Failed to fetch question data from Zhihu");throw new W("FETCH_ERROR",G?`Zhihu question answers request failed (HTTP ${G})`:"Zhihu question answers request failed","Try again later or rerun with -v for more detail")}for(const G of B.data||[]){const J=h(G);if(Y.has(J))continue;Y.add(J);V.push(G);if(V.length>=O)break}if(B.paging?.is_end)break;P=typeof B.paging?.next==="string"?B.paging.next:""}return V.map((B,G)=>{const J=$(B);return{rank:G+1,id:J,author:B.author?.name||"anonymous",votes:B.voteup_count||0,url:J?`https://www.zhihu.com/question/${N}/answer/${J}`:"",content:S(B.content||"").substring(0,200)}})}});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{cli as Y,Strategy as Z}from"@jackwener/opencli/registry";import{AuthRequiredError as $,CliError as V}from"@jackwener/opencli/errors";function b(J){const x=J.target||{},B=x.id==null?"":String(x.id);if(x.type==="answer"){const G=x.question?.id==null?"":String(x.question.id);return G&&B?`https://www.zhihu.com/question/${G}/answer/${B}`:""}if(x.type==="article")return B?`https://zhuanlan.zhihu.com/p/${B}`:"";if(x.type==="question")return B?`https://www.zhihu.com/question/${B}`:"";return""}function f(J){const x=J.target||{};if(x.type==="answer")return x.question?.title||"";return x.title||x.question?.title||""}const W=1000;Y({site:"zhihu",name:"recommend",access:"read",description:"知乎首页推荐",domain:"www.zhihu.com",strategy:Z.COOKIE,args:[{name:"limit",type:"int",default:20,help:"Number of items to return (max 1000; use normal-sized requests)"}],columns:["rank","type","title","author","votes","url"],func:async(J,x)=>{const B=Number(x.limit??20);if(!Number.isInteger(B)||B<=0||B>W)throw new V("INVALID_INPUT",`Limit must be a positive integer no greater than ${W}`,"Use a normal-sized limit to avoid slow requests or Zhihu risk controls");await J.goto("https://www.zhihu.com");let G="https://www.zhihu.com/api/v3/feed/topstory/recommend?limit=10&desktop=true";const N=[],O=new Set,P=new Set;while(G&&N.length<B&&!P.has(G)){P.add(G);const D=await J.evaluate(`
|
|
2
|
+
(async () => {
|
|
3
|
+
const r = await fetch(${JSON.stringify(G)}, { credentials: 'include' });
|
|
4
|
+
if (!r.ok) return { __httpError: r.status };
|
|
5
|
+
return await r.json();
|
|
6
|
+
})()
|
|
7
|
+
`);if(!D||D.__httpError){const F=D?.__httpError;if(F===401||F===403)throw new $("www.zhihu.com","Failed to fetch Zhihu recommendations");throw new V("FETCH_ERROR",F?`Zhihu recommendations request failed (HTTP ${F})`:"Zhihu recommendations request failed","Try again later or rerun with -v for more detail")}for(const F of D.data||[]){const H=F.target||{},Q=H.id;let K=null;if(Q!=null)K=`${H.type??""}:${Q}`;else if(F.id!=null)K=`__feed:${F.id}`;if(K!=null){if(O.has(K))continue;O.add(K)}N.push(F);if(N.length>=B)break}if(D.paging?.is_end)break;G=typeof D.paging?.next==="string"?D.paging.next:""}return N.map((D,F)=>{const H=D.target||{};return{rank:F+1,type:H.type||D.type||"",title:f(D),author:H.author?.name||"",votes:H.voteup_count??H.reaction?.statistics?.like_count??0,url:b(D)}})}});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{cli as v,Strategy as h}from"@jackwener/opencli/registry";import{ArgumentError as K,AuthRequiredError as S,CommandExecutionError as $,EmptyResultError as q}from"@jackwener/opencli/errors";import{stripHtml as M}from"./text.js";function U(D){const B=D.object||{};if(B.id!=null)return`${B.type||""}:${B.id}`;return null}function A(D){const B=D.id==null?"":String(D.id);if(D.type==="answer"){const N=D.question?.id==null?"":String(D.question.id);return N&&B?`https://www.zhihu.com/question/${N}/answer/${B}`:""}if(D.type==="article")return B?`https://zhuanlan.zhihu.com/p/${B}`:"";if(D.type==="question")return B?`https://www.zhihu.com/question/${B}`:"";return""}function L(D){if(typeof D!=="string"||!D)return"";try{const B=new URL(D);if(B.hostname==="api.zhihu.com"&&B.pathname==="/search_v3")return`https://www.zhihu.com/api/v4/search_v3${B.search}`;if(B.hostname==="www.zhihu.com"&&B.pathname==="/api/v4/search_v3")return B.toString()}catch{return""}return""}const C=1000,w=20,Q=["all","answer","article","question"];function R(D){const B=Number(D??10);if(!Number.isInteger(B)||B<=0||B>C)throw new K(`zhihu search --limit must be a positive integer no greater than ${C}`,"Use a normal-sized limit to avoid slow requests or Zhihu risk controls");return B}function z(D){const B=String(D||"").trim();if(!B)throw new K("zhihu search query must not be empty","Example: opencli zhihu search codex");return B}function I(D){const B=String(D||"all");if(!Q.includes(B))throw new K(`zhihu search --type must be one of: ${Q.join(", ")}`,"Example: opencli zhihu search codex --type answer");return B}function H(D){if(D&&typeof D==="object"&&"data"in D&&"session"in D)return D.data;return D}function P(D,B){const N=H(D);if(!N||typeof N!=="object"||Array.isArray(N))throw new $("Zhihu search returned malformed payload");if(N.__httpError){const O=N.__httpError;if(O===401||O===403)throw new S("www.zhihu.com","Failed to fetch search results from Zhihu");throw new $(`Zhihu search request failed${O?` (HTTP ${O})`:""}`,"Try again later or rerun with -v for more detail")}if(N.__fetchError)throw new $("Zhihu search request failed",String(N.__fetchError));if(!Array.isArray(N.data))throw new $("Zhihu search returned malformed data list",`URL: ${B}`);if(!N.paging||typeof N.paging!=="object")throw new $("Zhihu search returned malformed paging data",`URL: ${B}`);return N}function T(D){return`
|
|
2
|
+
(async () => {
|
|
3
|
+
try {
|
|
4
|
+
const r = await fetch(${JSON.stringify(D)}, { credentials: 'include' });
|
|
5
|
+
if (!r.ok) return { __httpError: r.status };
|
|
6
|
+
return await r.json();
|
|
7
|
+
} catch (err) {
|
|
8
|
+
return { __fetchError: err?.message || String(err) };
|
|
9
|
+
}
|
|
10
|
+
})()
|
|
11
|
+
`}async function k(D,B){let N=H(await D.evaluate(T(B)));if(N&&typeof N==="object"&&!Array.isArray(N)&&N.__fetchError){await D.goto("https://www.zhihu.com");N=H(await D.evaluate(T(B)))}return P(N,B)}function x(D){if(!D||typeof D!=="object"||D.type!=="search_result"||!D.object||typeof D.object!=="object")return null;const B=D.object;if(B.type!=="answer"&&B.type!=="article"&&B.type!=="question")return null;const N=U(D),O=A(B),V=B.question||{},W=M(B.title||V.name||V.title||"");if(!N||!O||!W)throw new $("Zhihu search returned malformed result row identity");return{item:D,key:N,row:{title:W,type:B.type,author:B.author?.name||"",votes:B.voteup_count||0,url:O}}}v({site:"zhihu",name:"search",access:"read",description:"知乎搜索",domain:"www.zhihu.com",strategy:h.COOKIE,args:[{name:"query",required:!0,positional:!0,help:"Search query"},{name:"limit",type:"int",default:10,help:"Number of results (max 1000; use normal-sized requests)"},{name:"type",default:"all",choices:Q,help:"Result type: all, answer, article, or question"}],columns:["rank","title","type","author","votes","url"],func:async(D,B)=>{const N=z(B.query),O=R(B.limit),V=I(B.type);await D.goto("https://www.zhihu.com");let W=`https://www.zhihu.com/api/v4/search_v3?q=${encodeURIComponent(N)}&t=general&offset=0&limit=${w}`;const G=[],X=new Set,J=new Set;while(W&&G.length<O&&!J.has(W)){J.add(W);const Z=await k(D,W);for(const Y of Z.data){const _=Y?.object?.type;if(V!=="all"&&_&&_!==V)continue;const F=x(Y);if(!F)continue;if(V!=="all"&&F.row.type!==V)continue;if(X.has(F.key))continue;X.add(F.key);G.push(F.row);if(G.length>=O)break}if(G.length>=O)break;if(Z.paging?.is_end)break;const f=L(Z.paging?.next);if(!f)throw new $("Zhihu search pagination returned malformed next URL");if(J.has(f))throw new $("Zhihu search pagination returned a repeated next URL");W=f}if(G.length===0)throw new q("zhihu search",`No ${V==="all"?"":`${V} `}results found for "${N}"`);return G.map((Z,f)=>{return{rank:f+1,...Z}})}});export const __test__={stripHtml:M,itemKey:U,itemUrl:A,normalizeSearchUrl:L,parseLimit:R,requireQuery:z,requireType:I,unwrapEvaluateResult:H,requireSearchPayload:P,fetchSearchPage:k,normalizeResultItem:x};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{cli as Z,Strategy as _}from"@jackwener/opencli/registry";import{AuthRequiredError as $,CommandExecutionError as b,EmptyResultError as f}from"@jackwener/opencli/errors";function h(B){if(!B)return"";const D=new Date(B*1000),K=(M)=>String(M).padStart(2,"0");return`${D.getFullYear()}-${K(D.getMonth()+1)}-${K(D.getDate())} ${K(D.getHours())}:${K(D.getMinutes())}`}function A(B,D,K){if(!D)return"";if(B==="article")return`https://zhuanlan.zhihu.com/p/${D}`;if(B==="answer")return K?`https://www.zhihu.com/question/${K}/answer/${D}`:`https://www.zhihu.com/answer/${D}`;if(B==="pin")return`https://www.zhihu.com/pin/${D}`;if(B==="zvideo")return`https://www.zhihu.com/zvideo/${D}`;if(B==="question")return`https://www.zhihu.com/question/${D}`;return""}function X(B){if(typeof B!=="string"||!B||B.includes("NaN"))return"";return B}Z({site:"zhihu",name:"stats",access:"read",description:"知乎内容数据(每篇阅读/赞同/收藏/评论等全量运营指标)",domain:"www.zhihu.com",strategy:_.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"limit",type:"number",default:20,help:"返回条数"}],columns:["id","type","title","url","published_at","views","likes","comments","collects","shares","shows","favors","reposts","new_followers","finish_read_rate","interact_rate","mark","extra"],func:async(B,D)=>{const K=Math.max(1,Number(D.limit)||20);await B.goto("https://www.zhihu.com/creator/manage/creation/all");await B.wait(2);const M=await B.evaluate(`(async () => {
|
|
2
|
+
const LIMIT = ${K};
|
|
3
|
+
// 大整数 id 加引号保精度(知乎内容 id 19 位,超出 JS Number 安全范围)
|
|
4
|
+
const safeParse = (text) => JSON.parse(
|
|
5
|
+
text.replace(/("(?:id|question_id|url_token)"\\s*:\\s*)(\\d{15,})/g, '$1"$2"')
|
|
6
|
+
);
|
|
7
|
+
const getJson = async (url) => {
|
|
8
|
+
const r = await fetch(url, { credentials: 'include' });
|
|
9
|
+
if (!r.ok) return { __http: r.status };
|
|
10
|
+
return safeParse(await r.text());
|
|
11
|
+
};
|
|
12
|
+
// 1) 内容列表,按页面原始参数逐页拉取(跟随 paging.next)
|
|
13
|
+
let url = '/api/v4/creators/creations/v2/all?start=0&end=0&limit=10&offset=0&need_co_creation=1&sort_type=created';
|
|
14
|
+
const items = [];
|
|
15
|
+
let totals = null;
|
|
16
|
+
for (let guard = 0; guard < 50 && items.length < LIMIT; guard++) {
|
|
17
|
+
const resp = await getJson(url);
|
|
18
|
+
if (resp && resp.__http) return { error: 'HTTP ' + resp.__http, stage: 'list' };
|
|
19
|
+
const data = Array.isArray(resp && resp.data) ? resp.data : [];
|
|
20
|
+
if (resp && resp.paging && typeof resp.paging.totals === 'number') totals = resp.paging.totals;
|
|
21
|
+
items.push(...data);
|
|
22
|
+
if (!resp || !resp.paging || resp.paging.is_end || !resp.paging.next || data.length === 0) break;
|
|
23
|
+
url = resp.paging.next;
|
|
24
|
+
}
|
|
25
|
+
// 2) 逐篇取单篇数据页的聚合指标(失败不阻断,仅缺列)
|
|
26
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
27
|
+
const rows = [];
|
|
28
|
+
for (const item of items.slice(0, LIMIT)) {
|
|
29
|
+
const d = item.data || {};
|
|
30
|
+
let aggr = null;
|
|
31
|
+
try {
|
|
32
|
+
const a = await getJson('/api/v4/creators/analysis/realtime/content/aggr?type='
|
|
33
|
+
+ encodeURIComponent(item.type) + '&token=' + encodeURIComponent(String(d.id || ''))
|
|
34
|
+
+ '&end=' + today);
|
|
35
|
+
if (a && !a.__http && typeof a.pv !== 'undefined') aggr = a;
|
|
36
|
+
} catch (e) { /* 单篇聚合失败降级到列表指标 */ }
|
|
37
|
+
rows.push({ type: item.type, data: d, reaction: item.reaction || {}, aggr });
|
|
38
|
+
await new Promise((r) => setTimeout(r, 120));
|
|
39
|
+
}
|
|
40
|
+
return { rows, totals };
|
|
41
|
+
})()`),Q=M&&typeof M==="object"&&"data"in M&&"session"in M?M.data:M;if(!Q||Q.error){const F=Q&&Q.error;if(F==="HTTP 401"||F==="HTTP 403")throw new $("www.zhihu.com",`知乎创作中心接口返回 ${F},请先在 Chrome 中登录知乎`);throw new b(`知乎内容列表获取失败(${F||"响应为空"}),请确认已登录 www.zhihu.com 且创作中心可访问`)}const V=Array.isArray(Q.rows)?Q.rows:[];if(V.length===0)throw new f("zhihu stats","未获取到任何内容。请确认已登录知乎且账号发布过内容(回答/文章/想法)。");return V.map((F)=>{const G=F.data||{},L=F.reaction||{},z=F.aggr||null,W=z&&z.advanced||{},Y=z&&z.content_mark?z.content_mark.is_collapsed?"被折叠":z.content_mark.is_suggest?"获推荐":"":"",H={};if(z){if(z.pageshow_uv)H.详情页访客uv=z.pageshow_uv;if(z.play)H.播放量=z.play;if(z.reaction)H.想法互动数=z.reaction;if(z.like_and_reaction)H.喜欢加互动=z.like_and_reaction;if(z.follower_conversion_rate)H.粉丝转化率=z.follower_conversion_rate}if(L.reviewing_comment_count)H.审核中评论数=L.reviewing_comment_count;if(G.question_id)H.问题id=String(G.question_id);if(G.answered_question_token)H.关联问题token=String(G.answered_question_token);return{id:String(G.id??""),type:F.type??"",title:G.title??"",url:A(F.type,String(G.id??""),G.question_id?String(G.question_id):""),published_at:h(G.created_time),views:z?z.pv??L.read_count??"":L.read_count??"",likes:L.vote_up_count??(z?z.upvote:"")??"",comments:L.comment_count??(z?z.comment:"")??"",collects:L.collect_count??(z?z.collect:"")??"",shares:z?z.share??"":"",shows:z?z.show??"":"",favors:L.like_count??(z?z.like:"")??"",reposts:z&&z.re_pin!=null?z.re_pin:L.repin_count??"",new_followers:z?z.new_follow_uv??"":"",finish_read_rate:X(W.finish_read_percent),interact_rate:X(W.positive_interact_percent),mark:Y,extra:Object.keys(H).length?JSON.stringify(H):""}})}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CliError as o}from"@jackwener/opencli/errors";const c=/^user:([A-Za-z0-9_-]+)$/,w=/^question:(\d+)$/,u=/^answer:(\d+):(\d+)$/,l=/^article:(\d+)$/,p=/^\/people\/([A-Za-z0-9_-]+)\/?$/,d=/^\/question\/(\d+)\/?$/,m=/^\/question\/(\d+)\/answer\/(\d+)\/?$/,E=/^\/p\/(\d+)\/?$/,_=/^https:\/\/(?::)?@/i;function f(n){return n.protocol==="https:"&&n.username===""&&n.password===""&&n.port===""}export function parseTarget(n){const e=String(n).trim();if(_.test(e))throw new o("INVALID_INPUT","Zhihu write commands require a normal HTTPS Zhihu URL without malformed authority","Example: https://www.zhihu.com/question/123456");if(e.startsWith("answer:")&&!u.test(e))throw new o("INVALID_INPUT","Invalid answer target, expected answer:<questionId>:<answerId>","Example: opencli zhihu like answer:123:456 --execute");let t=e.match(c);if(t)return{kind:"user",slug:t[1],url:`https://www.zhihu.com/people/${t[1]}`};t=e.match(w);if(t)return{kind:"question",id:t[1],url:`https://www.zhihu.com/question/${t[1]}`};t=e.match(u);if(t)return{kind:"answer",questionId:t[1],id:t[2],url:`https://www.zhihu.com/question/${t[1]}/answer/${t[2]}`};t=e.match(l);if(t)return{kind:"article",id:t[1],url:`https://zhuanlan.zhihu.com/p/${t[1]}`};try{const i=new URL(e);if(!f(i))throw Error("unsupported zhihu url variant");if(i.hostname==="www.zhihu.com"){const r=i.pathname.match(p);if(r){const a=r[1];return{kind:"user",slug:a,url:`https://www.zhihu.com/people/${a}`}}const h=i.pathname.match(d);if(h)return{kind:"question",id:h[1],url:`https://www.zhihu.com/question/${h[1]}`};const s=i.pathname.match(m);if(s)return{kind:"answer",questionId:s[1],id:s[2],url:`https://www.zhihu.com/question/${s[1]}/answer/${s[2]}`}}if(i.hostname==="zhuanlan.zhihu.com"){const r=i.pathname.match(E);if(r)return{kind:"article",id:r[1],url:`https://zhuanlan.zhihu.com/p/${r[1]}`}}}catch{}throw new o("INVALID_INPUT","Zhihu write commands require a Zhihu URL or typed target like question:123 or answer:123:456","Example: opencli zhihu like answer:123:456 --execute")}export function assertAllowedKinds(n,e){if(!{follow:["user","question"],like:["answer","article"],favorite:["answer","article"],comment:["answer","article"],answer:["question"]}[n]?.includes(e.kind))throw new o("UNSUPPORTED_TARGET",`zhihu ${n} does not support ${e.kind} targets`);return e}export const __test__={parseTarget,assertAllowedKinds};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
function n(e){return Number.isInteger(e)&&e>=0&&e<=1114111?String.fromCodePoint(e):null}export function stripHtml(e,{preserveBlocks:p=!1}={}){if(!e)return"";let r=String(e);if(p)r=r.replace(/<br\s*\/?\s*>/gi,`
|
|
2
|
+
`).replace(/<\/(?:p|div|h[1-6]|li|blockquote)>/gi,`
|
|
3
|
+
|
|
4
|
+
`);return r.replace(/<[^>]+>/g,"").replace(/ /g," ").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'").replace(/&#(\d+);/g,(t,l)=>n(Number(l))??t).replace(/&#x([0-9a-f]+);/gi,(t,l)=>n(Number.parseInt(l,16))??t).replace(/\n{3,}/g,`
|
|
5
|
+
|
|
6
|
+
`).trim()}export const __test__={decodeEntity:n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as u,Strategy as c}from"@jackwener/opencli/registry";import{CommandExecutionError as a}from"@jackwener/opencli/errors";import{parseZhihuUser as d}from"./user-arg.js";import{fetchZhihuList as h,validateLimit as w}from"./paginate.js";const l="data[*].voteup_count,comment_count,created_time,question";u({site:"zhihu",name:"user-answers",access:"read",description:"知乎某用户的回答列表",domain:"www.zhihu.com",strategy:c.COOKIE,args:[{name:"user",type:"string",required:!0,positional:!0,help:"User url_token or people URL"},{name:"limit",type:"int",default:20,help:"Number of answers to return (max 1000)"}],columns:["rank","question","votes","comments","created","url"],func:async(i,o)=>{const r=d(o.user),n=w(o.limit);await i.goto("https://www.zhihu.com");const s=`https://www.zhihu.com/api/v4/members/${encodeURIComponent(r)}/answers?limit=20&offset=0&include=${encodeURIComponent(l)}`;return(await h(i,s,n,"user answers")).map((t,m)=>{const e=t.question||{};if(!t.id||!e.id||!e.title)throw new a("Zhihu user answers returned malformed row identity");return{rank:m+1,question:String(e.title||""),votes:t.voteup_count??t.reaction?.statistics?.like_count??0,comments:t.comment_count??0,created:t.created_time??t.created??0,url:e.id&&t.id?`https://www.zhihu.com/question/${e.id}/answer/${t.id}`:""}})}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CliError as J}from"@jackwener/opencli/errors";const N=/^[A-Za-z0-9_-]+$/,Q=/^user:([A-Za-z0-9_-]+)$/,V=/^\/people\/([A-Za-z0-9_-]+)\/?$/;export function parseZhihuUser(K){const q=String(K??"").trim();if(!q)throw new J("INVALID_INPUT","A Zhihu user is required","Example: opencli zhihu user wen-jie-16-47");const B=q.match(Q);if(B)return B[1];if(N.test(q))return q;try{const z=new URL(q);if(z.protocol==="https:"&&z.hostname==="www.zhihu.com"){const D=z.pathname.match(V);if(D)return D[1]}}catch{}throw new J("INVALID_INPUT",`Invalid Zhihu user: ${q}`,"Use a url_token (wen-jie-16-47) or a people URL (https://www.zhihu.com/people/wen-jie-16-47)")}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as s,Strategy as u}from"@jackwener/opencli/registry";import{CommandExecutionError as c}from"@jackwener/opencli/errors";import{parseZhihuUser as a}from"./user-arg.js";import{fetchZhihuList as l,validateLimit as h}from"./paginate.js";const p="data[*].voteup_count,comment_count";s({site:"zhihu",name:"user-articles",access:"read",description:"知乎某用户的文章/专栏列表",domain:"www.zhihu.com",strategy:u.COOKIE,args:[{name:"user",type:"string",required:!0,positional:!0,help:"User url_token or people URL"},{name:"limit",type:"int",default:20,help:"Number of articles to return (max 1000)"}],columns:["rank","title","votes","comments","created","url"],func:async(e,i)=>{const r=a(i.user),o=h(i.limit);await e.goto("https://www.zhihu.com");const n=`https://www.zhihu.com/api/v4/members/${encodeURIComponent(r)}/articles?limit=20&offset=0&include=${encodeURIComponent(p)}`;return(await l(e,n,o,"user articles")).map((t,m)=>{if(!t.id||!t.title)throw new c("Zhihu user articles returned malformed row identity");return{rank:m+1,title:String(t.title||""),votes:t.voteup_count??0,comments:t.comment_count??0,created:t.created??t.updated??0,url:`https://zhuanlan.zhihu.com/p/${t.id}`}})}});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{cli as s,Strategy as a}from"@jackwener/opencli/registry";import{AuthRequiredError as h,CommandExecutionError as n,EmptyResultError as l}from"@jackwener/opencli/errors";import{parseZhihuUser as c}from"./user-arg.js";import{unwrapEvaluateResult as w}from"./paginate.js";const _="follower_count,following_count,answer_count,articles_count,question_count,voteup_count,thanked_count,favorited_count,headline,gender";s({site:"zhihu",name:"user",access:"read",description:"知乎用户主页资料(粉丝/关注/回答/文章/获赞数)",domain:"www.zhihu.com",strategy:a.COOKIE,args:[{name:"user",type:"string",required:!0,positional:!0,help:"User url_token or people URL, e.g. wen-jie-16-47"}],columns:["url_token","name","headline","followers","following","answers","articles","voteup","url"],func:async(t,i)=>{const o=c(i.user);await t.goto("https://www.zhihu.com");const u=`https://www.zhihu.com/api/v4/members/${encodeURIComponent(o)}?include=${encodeURIComponent(_)}`,r=w(await t.evaluate(`
|
|
2
|
+
(async () => {
|
|
3
|
+
try {
|
|
4
|
+
const r = await fetch(${JSON.stringify(u)}, { credentials: 'include' });
|
|
5
|
+
if (!r.ok) return { __httpError: r.status };
|
|
6
|
+
return await r.json();
|
|
7
|
+
} catch (err) {
|
|
8
|
+
return { __fetchError: err?.message || String(err) };
|
|
9
|
+
}
|
|
10
|
+
})()
|
|
11
|
+
`));if(!r||typeof r!=="object"||Array.isArray(r)||r.__httpError||r.__fetchError){const e=r?.__httpError;if(e===401||e===403)throw new h("www.zhihu.com","Failed to fetch Zhihu user profile");if(e===404)throw new l("zhihu user",`No Zhihu user was found for ${o}.`);throw new n(e?`Zhihu user request failed (HTTP ${e})`:"Zhihu user request failed",r?.__fetchError?String(r.__fetchError):"Try again later or rerun with -v")}if(!r.url_token||!r.id||!r.name)throw new n("Zhihu user response missing identity fields","Zhihu may have changed its API shape");return[{url_token:String(r.url_token||""),name:String(r.name||""),headline:String(r.headline||""),followers:r.follower_count??0,following:r.following_count??0,answers:r.answer_count??0,articles:r.articles_count??0,voteup:r.voteup_count??0,url:r.url_token?`https://www.zhihu.com/people/${r.url_token}`:""}]}});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import{readFile as h,stat as A}from"node:fs/promises";import{CliError as Q}from"@jackwener/opencli/errors";const T=new Set(["status","outcome","message","target_type","target"]),$='header, nav, [role="banner"], [role="navigation"]',J='a[href^="/people/"]',W='img, [class*="Avatar"], [data-testid*="avatar" i], [aria-label*="头像"]',Y=["我","我的","个人主页"],z=[["self"],["current","user"],["account","profile"],["my","profile"],["my","account"]],C=JSON.stringify(z);function F(){return{readFile:h,stat:(j)=>A(j),decodeUtf8:(j)=>new TextDecoder("utf-8",{fatal:!0}).decode(j)}}function f(j){const q=j.toLowerCase();return Y.some((G)=>j.includes(G))||q.includes("my profile")||q.includes("my account")}function I(j){return j.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function _(j){const q=new Set(I(j));return z.some((G)=>G.every((B)=>q.has(B)))}function O(j){return typeof j==="object"&&j!==null&&"querySelectorAll"in j&&typeof j.querySelectorAll==="function"}function c(j){return typeof j==="object"&&j!==null&&"getAttribute"in j&&"querySelector"in j&&typeof j.getAttribute==="function"&&typeof j.querySelector==="function"}function L(j){const q=j?.topstory?.me?.slug||j?.me?.slug||j?.initialState?.me?.slug;return typeof q==="string"&&q?q:null}function x(j,q){const B=(j.getAttribute("href")||"").match(/^\/people\/([A-Za-z0-9_-]+)/);if(!B)return null;const H=j.getAttribute("aria-label")||"",X=j.getAttribute("title")||"",Z=j.getAttribute("data-testid")||"",M=j.getAttribute("class")||"",K=j.getAttribute("rel")||"",U=`${H} ${X} ${j.textContent||""}`,V=`${Z} ${M} ${K}`,b=Boolean(j.querySelector(W)),P=f(U),N=_(V);if(P||N)return B[1];if(q&&b)return B[1];return null}function D(j,q){for(const G of j)for(const B of Array.from(G.querySelectorAll(J)).filter(c)){const H=x(B,q);if(H)return H}return null}export function resolveCurrentUserSlugFromDom(j,q){const G=L(j);if(G)return G;const B=Array.from(q.querySelectorAll($)).filter(O);return D(B,!0)||D([q],!1)}export function requireExecute(j){if(!j.execute)throw new Q("INVALID_INPUT","此知乎写命令需要 --execute 才会真正执行。注意:本报错仅表示缺少 --execute,并未校验其余参数,不能当 dry-run 预览用")}export async function resolvePayload(j,q=F()){const G=typeof j.text==="string"?j.text:void 0,B=typeof j.file==="string"?j.file:void 0;if(G&&B)throw new Q("INVALID_INPUT","Use either <text> or --file, not both");let H=G??"";if(B){let X;try{X=await q.stat(B)}catch{throw new Q("INVALID_INPUT",`File not found: ${B}`)}if(!X.isFile())throw new Q("INVALID_INPUT",`File must be a readable text file: ${B}`);let Z;try{Z=await q.readFile(B)}catch{throw new Q("INVALID_INPUT",`File could not be read: ${B}`)}try{H=q.decodeUtf8(Z)}catch{throw new Q("INVALID_INPUT",`File could not be decoded as UTF-8 text: ${B}`)}}if(!H.trim())throw new Q("INVALID_INPUT","Payload cannot be empty or whitespace only");return H}function R(){return`(() => {
|
|
2
|
+
const selfLabelTokens = ${JSON.stringify(Y)};
|
|
3
|
+
const explicitIdentityMetaTokenGroups = ${C};
|
|
4
|
+
const navScopeSelector = ${JSON.stringify($)};
|
|
5
|
+
const profileLinkSelector = ${JSON.stringify(J)};
|
|
6
|
+
const avatarSelector = ${JSON.stringify(W)};
|
|
7
|
+
|
|
8
|
+
const hasExplicitIdentityLabel = (text) => {
|
|
9
|
+
const normalized = String(text || '').toLowerCase();
|
|
10
|
+
return selfLabelTokens.some((token) => String(text || '').includes(token))
|
|
11
|
+
|| normalized.includes('my profile')
|
|
12
|
+
|| normalized.includes('my account');
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const tokenizeIdentityMeta = (text) => String(text || '')
|
|
16
|
+
.toLowerCase()
|
|
17
|
+
.split(/[^a-z0-9]+/)
|
|
18
|
+
.filter(Boolean);
|
|
19
|
+
|
|
20
|
+
const hasExplicitIdentityMeta = (text) => {
|
|
21
|
+
const tokens = new Set(tokenizeIdentityMeta(text));
|
|
22
|
+
return explicitIdentityMetaTokenGroups.some((group) => group.every((token) => tokens.has(token)));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const getSlugFromIdentityLink = (node, allowAvatarOnly) => {
|
|
26
|
+
const href = node.getAttribute('href') || '';
|
|
27
|
+
const match = href.match(/^\\/people\\/([A-Za-z0-9_-]+)/);
|
|
28
|
+
if (!match) return null;
|
|
29
|
+
|
|
30
|
+
const aria = node.getAttribute('aria-label') || '';
|
|
31
|
+
const title = node.getAttribute('title') || '';
|
|
32
|
+
const testid = node.getAttribute('data-testid') || '';
|
|
33
|
+
const className = node.getAttribute('class') || '';
|
|
34
|
+
const rel = node.getAttribute('rel') || '';
|
|
35
|
+
const identityLabel = \`\${aria} \${title} \${node.textContent || ''}\`;
|
|
36
|
+
const identityMeta = \`\${testid} \${className} \${rel}\`;
|
|
37
|
+
const hasAvatar = Boolean(node.querySelector(avatarSelector));
|
|
38
|
+
|
|
39
|
+
if (hasExplicitIdentityLabel(identityLabel) || hasExplicitIdentityMeta(identityMeta)) return match[1];
|
|
40
|
+
if (allowAvatarOnly && hasAvatar) return match[1];
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const findCurrentUserSlugFromRoots = (roots, allowAvatarOnly) => {
|
|
45
|
+
for (const root of roots) {
|
|
46
|
+
for (const node of Array.from(root.querySelectorAll(profileLinkSelector))) {
|
|
47
|
+
const slug = getSlugFromIdentityLink(node, allowAvatarOnly);
|
|
48
|
+
if (slug) return slug;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const scopedGlobal = globalThis;
|
|
55
|
+
const state = scopedGlobal.__INITIAL_STATE__ || (scopedGlobal.window && scopedGlobal.window.__INITIAL_STATE__) || null;
|
|
56
|
+
const slugFromState = state && (state.topstory && state.topstory.me && state.topstory.me.slug)
|
|
57
|
+
|| (state && state.me && state.me.slug)
|
|
58
|
+
|| (state && state.initialState && state.initialState.me && state.initialState.me.slug);
|
|
59
|
+
if (typeof slugFromState === 'string' && slugFromState) return { slug: slugFromState };
|
|
60
|
+
|
|
61
|
+
const navScopes = Array.from(document.querySelectorAll(navScopeSelector));
|
|
62
|
+
const slug = findCurrentUserSlugFromRoots(navScopes, true) || findCurrentUserSlugFromRoots([document], false);
|
|
63
|
+
if (slug) return { slug };
|
|
64
|
+
|
|
65
|
+
var avatarImgs = document.querySelectorAll('header img[alt*="\\u4e3b\\u9875"]');
|
|
66
|
+
for (var ai = 0; ai < avatarImgs.length; ai++) {
|
|
67
|
+
var altMatch = (avatarImgs[ai].alt || '').match(/\\u70b9\\u51fb\\u6253\\u5f00(.+?)\\u7684\\u4e3b\\u9875/);
|
|
68
|
+
if (altMatch) return { slug: altMatch[1] };
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
})()`}export async function resolveCurrentUserIdentity(j){let q=null;for(let G=0;G<30;G++){q=await j.evaluate(R());if(q?.slug)break;await j.wait({time:0.5})}if(!q?.slug)throw new Q("ACTION_NOT_AVAILABLE","Could not resolve the logged-in Zhihu user identity before write");return q.slug}export function buildResultRow(j,q,G,B,H={}){for(const X of Object.keys(H))if(T.has(X))throw new Q("INVALID_INPUT",`Result extra field cannot overwrite reserved key: ${X}`);return[{status:"success",outcome:B,message:j,target_type:q,target:G,...H}]}export const __test__={requireExecute,resolvePayload,resolveCurrentUserIdentity,resolveCurrentUserSlugFromDom,buildResultRow};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as i,Strategy as l}from"@jackwener/opencli/registry";import{EmptyResultError as n}from"@jackwener/opencli/errors";import{ZLIBRARY_DOMAIN as s,extractBookTitle as d,extractFormats as m,normalizeZlibraryBookUrl as b}from"./utils.js";i({site:"zlibrary",name:"info",access:"read",description:"Get book details and available download formats from a Z-Library book page",domain:s,strategy:l.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"url",positional:!0,required:!0,help:"Z-Library book page URL (e.g. https://z-library.im/book/...)"}],columns:["title","pdf","epub","url"],func:async(t,e)=>{const a=b(e.url);await t.goto(a,{waitUntil:"load",settleMs:3000});await t.wait({time:5});const o=await d(t),r=await m(t);if(!o||!r.pdf&&!r.epub)throw new n("zlibrary info","Could not extract a book title and download formats. Check the URL, login state, and whether Z-Library changed its page layout.");return[{title:o,pdf:r.pdf||"",epub:r.epub||"",url:a}]}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as i,Strategy as l}from"@jackwener/opencli/registry";import{EmptyResultError as s}from"@jackwener/opencli/errors";import{ZLIBRARY_DOMAIN as n,buildSearchUrl as u,extractSearchResults as c}from"./utils.js";i({site:"zlibrary",name:"search",access:"read",description:"Search Z-Library for books by title, author, ISBN, or keyword",domain:n,strategy:l.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"query",positional:!0,required:!0,help:"Search keyword (title, author, ISBN, etc.)"},{name:"limit",type:"int",default:10,help:"Max results (1–25)"}],columns:["rank","title","author","url"],func:async(r,t)=>{const a=Math.max(1,Math.min(Number(t.limit)||10,25)),o=u(t.query);await r.goto(o,{waitUntil:"load",settleMs:3000});await r.wait({time:5});const e=await c(r,a);if(!e.length)throw new s("zlibrary search","No books found. Try a different keyword or check that you are logged into Z-Library.");return e}});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import{ArgumentError as K}from"@jackwener/opencli/errors";const ZLIBRARY_DOMAIN="z-library.im",ZLIBRARY_ORIGIN=`https://${ZLIBRARY_DOMAIN}`,P=new Set([ZLIBRARY_DOMAIN,`www.${ZLIBRARY_DOMAIN}`]);export function normalizeZlibraryBookUrl(C){const F=String(C||"").trim();let J;try{J=new URL(F)}catch{throw new K("Z-Library book URL must be a valid http(s) URL",`Example: ${ZLIBRARY_ORIGIN}/book/...`)}if(!["http:","https:"].includes(J.protocol)||!P.has(J.hostname))throw new K(`Unsupported Z-Library URL host: ${J.hostname}`,`Pass a book URL under ${ZLIBRARY_DOMAIN}, for example ${ZLIBRARY_ORIGIN}/book/...`);return J.toString()}export function buildSearchUrl(C){const F=String(C||"").trim();if(!F)throw new K("zlibrary search query cannot be empty");return`${ZLIBRARY_ORIGIN}/s/${encodeURIComponent(F)}`}export async function extractBookTitle(C){const F=await C.evaluate(`
|
|
2
|
+
(() => {
|
|
3
|
+
const card = document.querySelector('z-bookcard');
|
|
4
|
+
if (card && card.shadowRoot) {
|
|
5
|
+
const el = card.shadowRoot.querySelector('[class*="title"], h1, a');
|
|
6
|
+
if (el) return el.textContent.trim().split('\\n')[0].trim();
|
|
7
|
+
}
|
|
8
|
+
return document.title.replace(/\\s*[-|].*$/, '').trim();
|
|
9
|
+
})()
|
|
10
|
+
`);return String(F||"").trim()}export async function extractFormats(C){await C.evaluate(`
|
|
11
|
+
(() => {
|
|
12
|
+
const btn = document.querySelector(
|
|
13
|
+
'button[aria-label*="more" i], [class*="dots" i], [class*="more" i]'
|
|
14
|
+
);
|
|
15
|
+
if (btn) btn.click();
|
|
16
|
+
})()
|
|
17
|
+
`);await C.wait({time:3});const F=await C.evaluate(`
|
|
18
|
+
JSON.stringify((() => {
|
|
19
|
+
const res = { pdf: '', epub: '' };
|
|
20
|
+
document.querySelectorAll('a[href]').forEach(a => {
|
|
21
|
+
const h = a.href || '';
|
|
22
|
+
const t = (a.textContent || '').toUpperCase();
|
|
23
|
+
if (h.includes('/dl/') && t.includes('PDF')) res.pdf = h;
|
|
24
|
+
if (h.includes('/dl/') && t.includes('EPUB')) res.epub = h;
|
|
25
|
+
});
|
|
26
|
+
return res;
|
|
27
|
+
})())
|
|
28
|
+
`);return JSON.parse(F)}export async function extractSearchResults(C,F){const J=await C.evaluate(`
|
|
29
|
+
JSON.stringify(
|
|
30
|
+
Array.from(document.querySelectorAll('z-bookcard'))
|
|
31
|
+
.slice(0, ${F})
|
|
32
|
+
.map((card, index) => {
|
|
33
|
+
const text = card.textContent.trim();
|
|
34
|
+
const lines = text.split('\\n').map(l => l.trim()).filter(Boolean);
|
|
35
|
+
const title = lines[0] || '';
|
|
36
|
+
const author = lines[1] || '';
|
|
37
|
+
let url = '';
|
|
38
|
+
try {
|
|
39
|
+
if (card.shadowRoot) {
|
|
40
|
+
const link = card.shadowRoot.querySelector('a');
|
|
41
|
+
if (link) url = link.href || '';
|
|
42
|
+
}
|
|
43
|
+
} catch(e) {}
|
|
44
|
+
return { rank: index + 1, title, author, url };
|
|
45
|
+
})
|
|
46
|
+
.filter(item => item.url && item.title)
|
|
47
|
+
)
|
|
48
|
+
`);try{return JSON.parse(J)}catch{return[]}}export{ZLIBRARY_DOMAIN,ZLIBRARY_ORIGIN};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import{AuthRequiredError as D,CommandExecutionError as F}from"@jackwener/opencli/errors";import{registerSiteAuthCommands as H}from"../_shared/site-auth.js";async function G(B){await B.goto("https://wx.zsxq.com/");await B.wait(2);const z=await B.evaluate(`
|
|
2
|
+
(async () => {
|
|
3
|
+
const url = location.href;
|
|
4
|
+
if (/\\/login(\\b|$)/.test(url)) {
|
|
5
|
+
return { kind: 'auth', detail: 'zsxq wx page redirected to /login — anonymous session' };
|
|
6
|
+
}
|
|
7
|
+
try {
|
|
8
|
+
const r = await fetch('https://api.zsxq.com/v2/users/self', {
|
|
9
|
+
credentials: 'include',
|
|
10
|
+
headers: { Accept: 'application/json' },
|
|
11
|
+
});
|
|
12
|
+
if (r.status === 401 || r.status === 403) {
|
|
13
|
+
return { kind: 'auth', detail: 'zsxq /v2/users/self returned HTTP ' + r.status };
|
|
14
|
+
}
|
|
15
|
+
if (!r.ok) return { kind: 'http', httpStatus: r.status };
|
|
16
|
+
const d = await r.json();
|
|
17
|
+
if (d?.succeeded === false || !d?.resp_data?.user) {
|
|
18
|
+
return { kind: 'auth', detail: 'zsxq /v2/users/self returned succeeded=false — anonymous' };
|
|
19
|
+
}
|
|
20
|
+
const u = d.resp_data.user;
|
|
21
|
+
return { ok: true, user_id: String(u.user_id || u.id || ''), name: String(u.name || u.nickname || '') };
|
|
22
|
+
} catch (e) {
|
|
23
|
+
return { kind: 'exception', detail: String(e && e.message || e) };
|
|
24
|
+
}
|
|
25
|
+
})()
|
|
26
|
+
`);if(z?.kind==="auth")throw new D("zsxq.com",z.detail);if(z?.kind==="http")throw new F(`HTTP ${z.httpStatus} from zsxq /v2/users/self`);if(z?.kind==="exception")throw new F(`zsxq whoami failed: ${z.detail}`);if(!z?.ok)throw new F(`Unexpected zsxq probe: ${JSON.stringify(z)}`);if(!z.user_id)throw new D("zsxq.com","zsxq /v2/users/self 200 but user_id missing — incomplete session");return{user_id:z.user_id,name:z.name}}H({site:"zsxq",domain:"zsxq.com",loginUrl:"https://wx.zsxq.com/login",columns:["user_id","name"],verify:G,poll:async(B)=>{if(!await B.evaluate(`(async () => {
|
|
27
|
+
try {
|
|
28
|
+
const r = await fetch('https://api.zsxq.com/v2/users/self', { credentials: 'include', headers: { Accept: 'application/json' } });
|
|
29
|
+
if (!r.ok) return false;
|
|
30
|
+
const d = await r.json();
|
|
31
|
+
return !!(d?.resp_data?.user);
|
|
32
|
+
} catch { return false; }
|
|
33
|
+
})()`))throw new D("zsxq.com","Waiting for zsxq login");return G(B)}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as o,Strategy as c}from"@jackwener/opencli/registry";import{ensureZsxqAuth as n,ensureZsxqPage as m,fetchFirstJson as u,getTopicText as l,getTopicAuthor as p,getTopicUrl as d}from"./utils.js";o({site:"zsxq",name:"dynamics",access:"read",description:"获取所有星球的最新动态",domain:"wx.zsxq.com",strategy:c.COOKIE,browser:!0,args:[{name:"limit",type:"int",default:20,help:"Number of dynamics to return"}],columns:["time","group","author","title","comments","likes","url"],func:async(i,a)=>{await m(i);await n(i);const r=Math.max(1,Number(a.limit)||20),{data:s}=await u(i,[`https://api.zsxq.com/v2/dynamics?scope=general&count=${r}`]);return((s?.resp_data||s)?.dynamics||[]).slice(0,r).map((e)=>{const t=e.topic;if(!t)return{time:e.create_time||"",group:"",author:"",title:`[${e.action||"unknown"}]`,comments:0,likes:0,url:""};return{time:e.create_time||t.create_time||"",group:t.group?.name||"",author:p(t),title:l(t),comments:t.comments_count??0,likes:t.likes_count??0,url:d(t.topic_id)}})}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as a,Strategy as o}from"@jackwener/opencli/registry";import{ensureZsxqAuth as c,ensureZsxqPage as m,fetchFirstJson as n,getGroupsFromResponse as u}from"./utils.js";a({site:"zsxq",name:"groups",access:"read",description:"列出当前账号加入的星球",domain:"wx.zsxq.com",strategy:o.COOKIE,browser:!0,args:[{name:"limit",type:"int",default:50,help:"Number of groups to return"}],columns:["group_id","name","category","members","topics","joined_at","url"],func:async(s,i)=>{await m(s);await c(s);const e=Math.max(1,Number(i.limit)||50),{data:r}=await n(s,["https://api.zsxq.com/v2/groups"]);return u(r).slice(0,e).map((t)=>({group_id:t.group_id??"",name:t.name||"",category:t.category?.title||"",members:t.statistics?.subscriptions_count??0,topics:t.statistics?.topics_count??0,joined_at:t.user_specific?.join_time||"",valid_until:t.user_specific?.validity?.end_time||"",url:t.group_id?`https://wx.zsxq.com/group/${t.group_id}`:"https://wx.zsxq.com"}))}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as V,Strategy as W}from"@jackwener/opencli/registry";import{getActiveGroupId as X,ensureZsxqAuth as Y,ensureZsxqPage as _,fetchFirstJson as L,getGroupsFromResponse as $,getTopicsFromResponse as D,toTopicRow as S}from"./utils.js";V({site:"zsxq",name:"search",access:"read",description:"搜索星球内容",domain:"wx.zsxq.com",strategy:W.COOKIE,browser:!0,args:[{name:"keyword",required:!0,positional:!0,help:"Search keyword"},{name:"limit",type:"int",default:20,help:"Number of results to return"},{name:"group_id",help:"Optional group id; defaults to the active group in Chrome"}],columns:["topic_id","group","author","title","comments","likes","time","url"],func:async(b,z)=>{await _(b);await Y(b);const M=String(z.keyword||"").trim(),E=Math.max(1,Number(z.limit)||20),B=String(z.group_id||await X(b)),O=encodeURIComponent(M);let H=B;try{const{data:C}=await L(b,["https://api.zsxq.com/v2/groups"]),K=$(C).find((U)=>String(U.group_id)===B);if(K?.name)H=K.name}catch{}const{data:Q}=await L(b,[`https://api.zsxq.com/v2/search/groups/${B}/topics?keyword=${O}&count=${E}`]);return D(Q).slice(0,E).map((C)=>({...S(C),group:H}))}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as u,Strategy as d}from"@jackwener/opencli/registry";import{CliError as s}from"@jackwener/opencli/errors";import{getActiveGroupId as l,browserJsonRequest as h,ensureZsxqAuth as w,ensureZsxqPage as f,fetchFirstJson as _,getCommentsFromResponse as g,getTopicFromResponse as R,getTopicUrl as T,summarizeComments as $,toTopicRow as q}from"./utils.js";u({site:"zsxq",name:"topic",access:"read",description:"获取单个话题详情和评论",domain:"wx.zsxq.com",strategy:d.COOKIE,browser:!0,args:[{name:"id",required:!0,positional:!0,help:"Topic ID"},{name:"group_id",help:"Group ID (optional; defaults to active group in Chrome)"},{name:"comment_limit",type:"int",default:20,help:"Number of comments to fetch"}],columns:["topic_id","type","author","title","comments","likes","comment_preview","url"],func:async(o,n)=>{await f(o);await w(o);const t=String(n.id),c=String(n.group_id||await l(o)),p=Math.max(1,Number(n.comment_limit)||20),m=`https://api.zsxq.com/v2/groups/${c}/topics/${t}`,e=await h(o,m);if(e.status===404)throw new s("NOT_FOUND",`Topic ${t} not found`);if(!e.ok)throw new s("FETCH_ERROR",e.error||`Failed to fetch topic ${t}`,`Checked endpoint: ${m}`);const a=await _(o,[`https://api.zsxq.com/v2/groups/${c}/topics/${t}/comments?sort=asc&count=${p}`]),i=R(e.data);if(!i)throw new s("NOT_FOUND",`Topic ${t} not found`);const r=g(a.data);return[{...q({...i,comments:r,comments_count:i.comments_count??r.length}),comment_preview:$(r,5),url:T(i.topic_id??t)}]}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as r,Strategy as a}from"@jackwener/opencli/registry";import{getActiveGroupId as c,ensureZsxqAuth as m,ensureZsxqPage as n,fetchFirstJson as p,getTopicsFromResponse as u,toTopicRow as l}from"./utils.js";r({site:"zsxq",name:"topics",access:"read",description:"获取当前星球的话题列表",domain:"wx.zsxq.com",strategy:a.COOKIE,browser:!0,args:[{name:"limit",type:"int",default:20,help:"Number of topics to return"},{name:"group_id",help:"Optional group id; defaults to the active group in Chrome"}],columns:["topic_id","type","author","title","comments","likes","time","url"],func:async(t,o)=>{await n(t);await m(t);const i=Math.max(1,Number(o.limit)||20),e=String(o.group_id||await c(t)),{data:s}=await p(t,[`https://api.zsxq.com/v2/groups/${e}/topics?scope=all&count=${i}`]);return u(s).slice(0,i).map(l)}});
|