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,50 @@
|
|
|
1
|
+
import{ArgumentError as P}from"@jackwener/opencli/errors";const J=1,K=40;export function parseLimit(z,B=10){if(z===void 0||z===null||z==="")return B;const C=Number(z);if(!Number.isFinite(C)||!Number.isInteger(C))throw new P(`--limit must be an integer between ${J} and ${K}, got ${JSON.stringify(z)}`);if(C<J||C>K)throw new P(`--limit must be between ${J} and ${K}, got ${C}`);return C}export function buildSearchScript(z,B){return`
|
|
2
|
+
(async () => {
|
|
3
|
+
const apiQuery = JSON.stringify({
|
|
4
|
+
keyword: ${JSON.stringify(z)},
|
|
5
|
+
offset: 0,
|
|
6
|
+
orderby: 'display_date:desc',
|
|
7
|
+
size: ${B},
|
|
8
|
+
website: 'reuters'
|
|
9
|
+
});
|
|
10
|
+
const apiUrl = 'https://www.reuters.com/pf/api/v3/content/fetch/articles-by-search-v2?query=' + encodeURIComponent(apiQuery);
|
|
11
|
+
try {
|
|
12
|
+
const resp = await fetch(apiUrl, { credentials: 'include' });
|
|
13
|
+
const status = resp.status;
|
|
14
|
+
const statusText = resp.statusText || '';
|
|
15
|
+
const text = await resp.text();
|
|
16
|
+
let body = null;
|
|
17
|
+
let parseError = null;
|
|
18
|
+
if ((text || '').trim()) {
|
|
19
|
+
try { body = JSON.parse(text); } catch (e) { parseError = String((e && e.message) || e); }
|
|
20
|
+
}
|
|
21
|
+
return { ok: resp.ok, status, statusText, body, parseError, textPreview: (text || '').slice(0, 500) };
|
|
22
|
+
} catch (e) {
|
|
23
|
+
return { ok: false, status: 0, body: null, error: String((e && e.message) || e) };
|
|
24
|
+
}
|
|
25
|
+
})()
|
|
26
|
+
`}export function buildArticleDetailScript(){return`
|
|
27
|
+
(() => {
|
|
28
|
+
try {
|
|
29
|
+
const pageText = document.body ? (document.body.innerText || '') : '';
|
|
30
|
+
const authRequired = ${looksAuthWallText.toString()}([
|
|
31
|
+
window.location.href || '',
|
|
32
|
+
document.title || '',
|
|
33
|
+
pageText.slice(0, 4000),
|
|
34
|
+
].join('\\n')) || Boolean(document.querySelector('[data-testid*="paywall" i], [class*="paywall" i], [id*="paywall" i], [data-testid*="captcha" i], [class*="captcha" i]'));
|
|
35
|
+
const meta = document.getElementById('fusion-metadata');
|
|
36
|
+
let fusion = null;
|
|
37
|
+
if (meta) {
|
|
38
|
+
try { fusion = JSON.parse(meta.textContent || '{}'); } catch (e) { fusion = null; }
|
|
39
|
+
}
|
|
40
|
+
const article = fusion?.globalContent || null;
|
|
41
|
+
const paragraphs = Array.from(document.querySelectorAll('article [data-testid^="paragraph-"], article p'))
|
|
42
|
+
.map((p) => (p.textContent || '').trim())
|
|
43
|
+
.filter(Boolean);
|
|
44
|
+
const bodyText = paragraphs.length ? paragraphs.join('\\n\\n') : ((document.querySelector('article')?.innerText || '').trim() || null);
|
|
45
|
+
return { ok: true, authRequired, body: { article, bodyText } };
|
|
46
|
+
} catch (e) {
|
|
47
|
+
return { ok: false, error: String((e && e.message) || e) };
|
|
48
|
+
}
|
|
49
|
+
})()
|
|
50
|
+
`}export function isAuthStatus(z){return Number(z)===401||Number(z)===403}export function looksAuthWallText(z){const B=String(z??"").toLowerCase();return/datadome|captcha|verify you are human|human verification|access to this page has been denied|unusual traffic|subscribe to continue|subscription required|sign in to (continue|read|access)|log in to (continue|read|access)/.test(B)}function Q(z){if(!Array.isArray(z))return null;const B=z.map((C)=>typeof C==="string"?C:C?.name||C?.byline||"").map((C)=>String(C).trim()).filter(Boolean);return B.length?B.join(", "):null}function H(z){const B=String(z??"").trim();return B?B:null}function S(z){const B=String(z??"").trim();if(!B)return null;return B.split("T")[0]}function V(z){if(!z)return null;const B=String(z);if(/^https?:\/\//i.test(B))return B;return"https://www.reuters.com"+B}export function mapSearchArticles(z,B){const C=z?.result?.articles||z?.articles||[];if(!Array.isArray(C))return[];return C.filter((G)=>G&&typeof G==="object").slice(0,B).map((G,Y)=>({rank:Y+1,title:H(G.title||G.headlines?.basic),date:S(G.display_date||G.published_time),section:H(G.taxonomy?.section?.name),section_path:H(G.taxonomy?.section?.path),authors:Q(G.authors),url:V(G.canonical_url)})).filter((G)=>G.title&&G.url)}export function mapArticleDetail(z,B,C=null){if(!z&&!B)return null;return{title:H(z?.title||z?.headlines?.basic),date:S(z?.display_date||z?.published_time),section:H(z?.taxonomy?.section?.name),section_path:H(z?.taxonomy?.section?.path),authors:Q(z?.authors),description:H(z?.description?.basic||z?.subheadlines?.basic),word_count:Number.isFinite(z?.word_count)?z.word_count:null,url:V(z?.canonical_url)||H(C),body:H(B)}}export const __test__={MIN_LIMIT:J,MAX_LIMIT:K};
|
package/clis/rfc/rfc.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as u,Strategy as l}from"@jackwener/opencli/registry";import{EmptyResultError as m}from"@jackwener/opencli/errors";import{RFC_BASE as a,requireRfcNumber as d,rfcFetch as g,trimDate as p}from"./utils.js";u({site:"rfc",name:"rfc",access:"read",description:"Single IETF RFC metadata (title, abstract, working group, authors, std level)",domain:"datatracker.ietf.org",strategy:l.PUBLIC,browser:!1,args:[{name:"number",positional:!0,type:"int",required:!0,help:"RFC number (e.g. 9000, 791, 2616)"}],columns:["rfc","title","state","stdLevel","group","groupType","pages","published","authors","abstract","rfcEditorUrl","url"],func:async(o)=>{const r=d(o.number),e=`rfc${r}`,t=await g(`${a}/doc/${e}/doc.json`,`rfc ${r}`);if(!t||!t.name)throw new m("rfc rfc",`IETF datatracker returned no metadata for RFC ${r}.`);const s=Array.isArray(t.authors)?t.authors.map((n)=>String(n?.name??"").trim()).filter(Boolean).join(", "):"",i=String(t.group?.name??"").trim(),c=String(t.group?.type??"").trim();return[{rfc:r,title:String(t.title??"").trim(),state:String(t.state??"").trim(),stdLevel:String(t.std_level??"").trim(),group:i,groupType:c,pages:t.pages==null?null:Number(t.pages),published:p(t.time),authors:s,abstract:String(t.abstract??"").trim(),rfcEditorUrl:`https://www.rfc-editor.org/rfc/rfc${r}`,url:`${a}/doc/${e}/`}]}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ArgumentError as I,CommandExecutionError as H,EmptyResultError as J}from"@jackwener/opencli/errors";export const RFC_BASE="https://datatracker.ietf.org";const K="opencli-rfc-adapter (+https://github.com/jackwener/opencli)";export function requireRfcNumber(F){const q=F;if(q==null||String(q).trim()==="")throw new I("rfc number is required (e.g. 9000, 791, 2616)",'Pass the integer RFC number; do not include the "rfc" prefix.');const z=String(q).trim().toLowerCase().replace(/^rfc/,""),B=Number.parseInt(z,10);if(!Number.isInteger(B)||B<=0||String(B)!==z)throw new I(`rfc number "${F}" is not a valid RFC number`,"Pass a positive integer (e.g. 9000, 791, 2616).");if(B>999999)throw new I("rfc number must be <= 999999");return B}export async function rfcFetch(F,q){let z;try{z=await fetch(F,{headers:{"user-agent":K,accept:"application/json"}})}catch(G){throw new H(`${q} request failed: ${G?.message??G}`,"Check that datatracker.ietf.org is reachable from this network.")}if(z.status===404)throw new J(q,`IETF datatracker returned 404 for ${F}.`);if(z.status===429)throw new H(`${q} returned HTTP 429 (rate limited)`);if(!z.ok)throw new H(`${q} returned HTTP ${z.status}`);let B;try{B=await z.json()}catch(G){throw new H(`${q} returned malformed JSON: ${G?.message??G}`)}return B}export function trimDate(F){const q=String(F??"").trim();if(!q)return null;if(/^\d{4}-\d{2}-\d{2}/.test(q))return q.slice(0,10);return null}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as i,Strategy as a}from"@jackwener/opencli/registry";import{GEMS_BASE as m,gemsFetch as u,requireGemName as g,trimDate as l}from"./utils.js";i({site:"rubygems",name:"gem",access:"read",description:"Fetch a RubyGems.org gem's metadata (version, downloads, license, links)",domain:"rubygems.org",strategy:a.PUBLIC,browser:!1,args:[{name:"name",positional:!0,required:!0,help:'Gem name (e.g. "rails", "sidekiq")'}],columns:["gem","version","releasedAt","downloads","versionDownloads","license","authors","homepage","source","bugs","info","url"],func:async(o)=>{const r=g(o.name),n=`${m}/gems/${encodeURIComponent(r)}.json`,e=await u(n,"rubygems gem"),t=Array.isArray(e?.licenses)?e.licenses.filter(Boolean).join(", "):"",s=e?.metadata??{};return[{gem:String(e?.name??r).trim(),version:String(e?.version??"").trim(),releasedAt:l(e?.version_created_at),downloads:e?.downloads!=null?Number(e.downloads):null,versionDownloads:e?.version_downloads!=null?Number(e.version_downloads):null,license:t,authors:String(e?.authors??"").trim(),homepage:String(e?.homepage_uri??"").trim(),source:String(e?.source_code_uri??s.source_code_uri??"").trim(),bugs:String(e?.bug_tracker_uri??s.bug_tracker_uri??"").trim(),info:String(e?.info??"").trim(),url:String(e?.project_uri??`https://rubygems.org/gems/${r}`).trim()}]}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as l,Strategy as c}from"@jackwener/opencli/registry";import{EmptyResultError as y}from"@jackwener/opencli/errors";import{GEMS_BASE as g,gemsFetch as d,requireBoundedInt as h,requireString as p}from"./utils.js";l({site:"rubygems",name:"search",access:"read",description:"Search RubyGems.org gems by keyword",domain:"rubygems.org",strategy:c.PUBLIC,browser:!1,args:[{name:"query",positional:!0,required:!0,help:'Search keyword (e.g. "rails", "redis")'},{name:"limit",type:"int",default:30,help:"Max gems (1-100, single RubyGems page)"}],columns:["rank","gem","version","downloads","license","authors","info","url"],func:async(s)=>{const n=p(s.query,"query"),i=h(s.limit,30,100),a=`${g}/search.json?query=${encodeURIComponent(n)}&page=1`,o=await d(a,"rubygems search"),t=Array.isArray(o)?o:[];if(!t.length)throw new y("rubygems search",`No gems matched "${n}".`);return t.slice(0,i).map((e,m)=>{const r=String(e.name??"").trim(),u=Array.isArray(e.licenses)?e.licenses.filter(Boolean).join(", "):"";return{rank:m+1,gem:r,version:String(e.version??"").trim(),downloads:e.downloads!=null?Number(e.downloads):null,license:u,authors:String(e.authors??"").trim(),info:String(e.info??"").trim(),url:r?`https://rubygems.org/gems/${r}`:""}})}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ArgumentError as I,CommandExecutionError as K,EmptyResultError as L}from"@jackwener/opencli/errors";export const GEMS_BASE="https://rubygems.org/api/v1";const O="opencli-rubygems-adapter (+https://github.com/jackwener/opencli)",P=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;export function requireString(B,q){const z=String(B??"").trim();if(!z)throw new I(`rubygems ${q} cannot be empty`);return z}export function requireBoundedInt(B,q,z,H="limit"){const D=B??q,J=typeof D==="number"?D:Number(D);if(!Number.isInteger(J)||J<=0)throw new I(`rubygems ${H} must be a positive integer`);if(J>z)throw new I(`rubygems ${H} must be <= ${z}`);return J}export function requireGemName(B){const q=String(B??"").trim();if(!q)throw new I('rubygems gem name is required (e.g. "rails", "sidekiq")');if(q.length>100||!P.test(q))throw new I(`rubygems gem "${B}" is not a valid gem name`,'Use letters / digits / "._-", starting with a letter or digit (max 100 chars).');return q}export async function gemsFetch(B,q){let z;try{z=await fetch(B,{headers:{"user-agent":O,accept:"application/json"}})}catch(D){throw new K(`${q} request failed: ${D?.message??D}`,"Check that rubygems.org is reachable from this network.")}if(z.status===404)throw new L(q,`RubyGems returned 404 for ${B}.`);if(z.status===429)throw new K(`${q} returned HTTP 429 (rate limited)`,"RubyGems throttles bursts; wait a few seconds and retry.");if(!z.ok)throw new K(`${q} returned HTTP ${z.status}`);let H;try{H=await z.json()}catch(D){throw new K(`${q} returned malformed JSON: ${D?.message??D}`)}return H}export function trimDate(B){const q=String(B??"").trim();if(!q)return null;const z=q.replace(/\.\d+/,"");return z.endsWith("Z")?z:`${z}Z`}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export const SF_SIGNED_GET_JS=`
|
|
2
|
+
async function __sfSignedGet(path) {
|
|
3
|
+
let srvSec = null;
|
|
4
|
+
try {
|
|
5
|
+
const h = await fetch("/", { method: "HEAD" });
|
|
6
|
+
const dh = h.headers.get("date");
|
|
7
|
+
if (dh) { const t = new Date(dh).getTime(); if (!isNaN(t)) srvSec = Math.floor(t / 1000); }
|
|
8
|
+
} catch (e) {}
|
|
9
|
+
const key = Object.keys(window).find((k) => k.startsWith("webpackChunk"));
|
|
10
|
+
if (!key) return { __sfErr: "页面未就绪:未找到 webpack 运行时,无法复用思否请求签名(请确认已停在 segmentfault.com 页面)" };
|
|
11
|
+
let req;
|
|
12
|
+
try { window[key].push([[Symbol("pp_sf_" + Math.random())], {}, (r) => { req = r; }]); }
|
|
13
|
+
catch (e) { return { __sfErr: "注入 webpack 探针失败:" + String(e) }; }
|
|
14
|
+
if (!req || !req.m) return { __sfErr: "无法取得 webpack require(思否前端结构可能已变)" };
|
|
15
|
+
let modId = null;
|
|
16
|
+
for (const id of Object.keys(req.m)) {
|
|
17
|
+
let s = "";
|
|
18
|
+
try { s = String(req.m[id]); } catch (e) { continue; }
|
|
19
|
+
if (/function getUrl/.test(s) && s.indexOf("/gateway") !== -1) { modId = id; break; }
|
|
20
|
+
}
|
|
21
|
+
if (!modId) return { __sfErr: "未定位到思否请求签名模块(getUrl/gateway),站点前端结构可能已变,需更新 adapter" };
|
|
22
|
+
let RequestClass;
|
|
23
|
+
try { RequestClass = req(modId).default; } catch (e) { return { __sfErr: "加载思否请求模块失败:" + String(e) }; }
|
|
24
|
+
if (typeof RequestClass !== "function") return { __sfErr: "思否请求模块导出异常(default 非构造器)" };
|
|
25
|
+
let xhr = null;
|
|
26
|
+
const OrigOpen = XMLHttpRequest.prototype.open;
|
|
27
|
+
XMLHttpRequest.prototype.open = function (method, url) {
|
|
28
|
+
try { if (String(url).indexOf(path) !== -1) xhr = this; } catch (e) {}
|
|
29
|
+
return OrigOpen.apply(this, arguments);
|
|
30
|
+
};
|
|
31
|
+
try {
|
|
32
|
+
const inst = new RequestClass({ Token: "", userAgent: navigator.userAgent });
|
|
33
|
+
if (srvSec) inst.setServerTime(srvSec);
|
|
34
|
+
await inst.send(path, { method: "GET" }).catch(function () {});
|
|
35
|
+
} catch (e) {
|
|
36
|
+
XMLHttpRequest.prototype.open = OrigOpen;
|
|
37
|
+
return { __sfErr: "签名请求执行失败:" + String(e) };
|
|
38
|
+
}
|
|
39
|
+
XMLHttpRequest.prototype.open = OrigOpen;
|
|
40
|
+
if (!xhr) return { __sfErr: "签名请求未发出(Request.send 未触发 XHR,思否前端结构可能已变)" };
|
|
41
|
+
return { status: xhr.status, raw: String(xhr.responseText || "") };
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{CliError as N,CommandExecutionError as P}from"@jackwener/opencli/errors";import{cli as v,Strategy as p}from"@jackwener/opencli/registry";import{publishArticle as f}from"../_shared/article/publish.js";import{readFile as I,stat as w}from"node:fs/promises";function u(W){if(!W.execute)throw new N("INVALID_INPUT","本命令需要 --execute 才会真正发布,请确认后加上 --execute。注意:本报错仅表示缺少 --execute,并未校验其余参数,不能当 dry-run 预览用")}async function h(W){const H=typeof W.text==="string"?W.text:void 0,V=typeof W.file==="string"?W.file:void 0;if(H&&V)throw new N("INVALID_INPUT","请只传 <text> 或 --file 之一,不能同时使用");let B=H??"";if(V){let A;try{A=await w(V)}catch{throw new N("INVALID_INPUT",`文件不存在:${V}`)}if(!A.isFile())throw new N("INVALID_INPUT",`路径必须是可读文本文件:${V}`);let M;try{M=await I(V)}catch{throw new N("INVALID_INPUT",`无法读取文件:${V}`)}try{B=new TextDecoder("utf-8",{fatal:!0}).decode(M)}catch{throw new N("INVALID_INPUT",`文件编码不是 UTF-8:${V}`)}}if(!B.trim())throw new N("INVALID_INPUT","正文不能为空");return B}function x(W,H,V,B,A={}){return[{status:"success",outcome:B,message:W,target_type:H,target:V,...A}]}export const segmentfaultProfile={home:"https://segmentfault.com/write",outputFormat:"markdown",image:{skip:["image-static.segmentfault.com","avatar-static.segmentfault.com"],allowRelative:!0,uploadFn:async(W,H)=>{const B=await(await fetch("https://segmentfault.com/write",{credentials:"include"})).text();let A=null;const M=B.match(/serverData"\s*:\s*\{\s*"Token"\s*:\s*"([^"]+)"/);if(M)A=M[1];else{const U="window.g_initialProps = ",R=B.indexOf(U);if(R!==-1){const q=B.indexOf(`;
|
|
2
|
+
</script>`,R);if(q!==-1)try{const L=JSON.parse(B.substring(R+U.length,q));A=L&&L.global&&L.global.sessionInfo&&L.global.sessionInfo.key}catch(L){}}}if(!A)throw Error("获取思否 session token 失败");const O=await fetch(W,{credentials:"omit"});if(!O.ok)throw Error("下载图片失败:"+O.status);const b=await O.blob(),E=new FormData;E.append("image",b);const F=await(await fetch("https://segmentfault.com/gateway/image",{method:"POST",credentials:"include",headers:{token:A},body:E})).text();if(F==="Unauthorized"||F.includes("禁言")||F.includes("锁定"))throw Error(F==="Unauthorized"?"未授权,请检查登录态":F);let X;try{X=JSON.parse(F)}catch(U){throw Error("图片上传失败:"+F)}let T=null;if(X&&X.url)T=X.url;else if(X&&X.result)T=X.result;else if(Array.isArray(X)){if(X[0]===1)throw Error(X[1]||"图片上传失败");T=X[1]||(X[2]?"https://image-static.segmentfault.com/"+X[2]:null)}if(!T)throw Error("图片上传失败,服务端未返回 URL");return{url:T}}},publish:async(W,H)=>{const V=W.params||{},A=await(await fetch("https://segmentfault.com/write",{credentials:"include"})).text();let M=null;const O=A.match(/serverData"\s*:\s*\{\s*"Token"\s*:\s*"([^"]+)"/);if(O)M=O[1];else{const Q="window.g_initialProps = ",z=A.indexOf(Q);if(z!==-1){const J=A.indexOf(`;
|
|
3
|
+
</script>`,z);if(J!==-1)try{const K=JSON.parse(A.substring(z+Q.length,J));M=K&&K.global&&K.global.sessionInfo&&K.global.sessionInfo.key}catch(K){}}}if(!M)return{ok:!1,stage:"token",status:0,message:"获取思否 session token 失败:请确认已登录;账号首次发文会被新手确认页(/howtowrite)拦住,需先在网页端进一次写作页点「我已知晓,继续撰写」"};async function b(Q){let z=null;try{const D=(await fetch("/",{method:"HEAD"})).headers.get("date");if(D){const S=new Date(D).getTime();if(!isNaN(S))z=Math.floor(S/1000)}}catch($){}const J=Object.keys(window).find(($)=>$.startsWith("webpackChunk"));if(!J)return{__sfErr:"页面未就绪:未找到 webpack 运行时,无法复用思否请求签名"};let K;try{window[J].push([[Symbol("pp_sf_"+Math.random())],{},($)=>{K=$}])}catch($){return{__sfErr:"注入 webpack 探针失败:"+String($)}}if(!K||!K.m)return{__sfErr:"无法取得 webpack require(思否前端结构可能已变)"};let Y=null;for(const $ of Object.keys(K.m)){let D="";try{D=String(K.m[$])}catch(S){continue}if(/function getUrl/.test(D)&&D.indexOf("/gateway")!==-1){Y=$;break}}if(!Y)return{__sfErr:"未定位到思否请求签名模块(getUrl/gateway),站点前端结构可能已变,需更新 adapter"};let j;try{j=K(Y).default}catch($){return{__sfErr:"加载思否请求模块失败:"+String($)}}if(typeof j!=="function")return{__sfErr:"思否请求模块导出异常(default 非构造器)"};let Z=null;const C=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function($,D){try{if(String(D).indexOf(Q)!==-1)Z=this}catch(S){}return C.apply(this,arguments)};try{const $=new j({Token:M,userAgent:navigator.userAgent});if(z)$.setServerTime(z);await $.send(Q,{method:"GET"}).catch(function(){})}catch($){XMLHttpRequest.prototype.open=C;return{__sfErr:"签名请求执行失败:"+String($)}}XMLHttpRequest.prototype.open=C;if(!Z)return{__sfErr:"签名请求未发出(Request.send 未触发 XHR)"};return{status:Z.status,raw:String(Z.responseText||"")}}if(W.draftOnly){const Q={title:W.title,tags:[],text:W.content,object_id:"",type:"article"},z=await fetch("https://segmentfault.com/gateway/draft",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",token:M,accept:"*/*"},body:JSON.stringify(Q)}),J=await z.text();if(J==="Unauthorized"||J.includes("禁言")||J.includes("锁定"))return{ok:!1,stage:"publish",status:z.status,message:J==="Unauthorized"?"未授权":J};let K;try{K=JSON.parse(J)}catch(Y){return{ok:!1,stage:"publish",status:z.status,message:"解析响应失败:"+J.slice(0,200)}}if(Array.isArray(K)){if(K[0]===1)return{ok:!1,stage:"publish",status:z.status,message:K[1]||"发布失败"};const Y=K[1];if(Y&&Y.id)return{ok:!0,draft:!0,id:String(Y.id),url:"https://segmentfault.com/write?draftId="+Y.id}}if(!K||!K.id){const Y=K&&(K.message||K.msg||K.error||K.errMsg)||J.slice(0,200);return{ok:!1,stage:"publish",status:z.status,message:Y}}return{ok:!0,draft:!0,id:String(K.id),url:"https://segmentfault.com/write?draftId="+K.id}}const E={"Content-Type":"application/json",token:M,accept:"*/*"},_=Array.isArray(V.tags)?V.tags.map((Q)=>String(Q).trim()).filter(Boolean):[];if(_.length===0)return{ok:!1,stage:"tags",message:"思否发文必须至少指定 1 个标签(--tags),合法标签可用 `segmentfault tags <名称>` 校验"};const F=[];for(const Q of _){const z=await b("/tag/"+encodeURIComponent(Q));if(z&&z.__sfErr)return{ok:!1,stage:"tags",message:"标签「"+Q+"」校验失败:"+z.__sfErr};let J;try{J=JSON.parse(z.raw)}catch(Y){return{ok:!1,stage:"tags",status:z.status,message:"解析标签「"+Q+"」响应失败(HTTP "+z.status+"):"+String(z.raw).slice(0,200)}}if(z.status!==200||typeof J==="string")return{ok:!1,stage:"tags",status:z.status,message:"思否标签接口请求被拒(HTTP "+z.status+"):"+(typeof J==="string"?J:String(z.raw).slice(0,120))};const K=J&&J.tag;if(!K||K.id==null)return{ok:!1,stage:"tags",message:"思否上找不到标签「"+Q+"」,请用 `segmentfault tags <名称>` 确认存在再发布"};F.push(K.id)}const X=Array.isArray(V.channels)?V.channels.map((Q)=>String(Q).trim()).filter(Boolean):[],T=[];if(X.length>0){let Q=[];const z=await b("/channels");if(z&&z.__sfErr)return{ok:!1,stage:"channels",message:"获取思否频道列表失败:"+z.__sfErr};let J;try{J=JSON.parse(z.raw)}catch(K){return{ok:!1,stage:"channels",status:z.status,message:"解析频道列表失败(HTTP "+z.status+"):"+String(z.raw).slice(0,200)}}if(z.status!==200||typeof J==="string")return{ok:!1,stage:"channels",status:z.status,message:"思否频道接口请求被拒(HTTP "+z.status+"):"+(typeof J==="string"?J:String(z.raw).slice(0,120))};if(Array.isArray(J))Q=J;else if(J&&Array.isArray(J.data))Q=J.data;else if(J&&Array.isArray(J.rows))Q=J.rows;else if(J&&Array.isArray(J.channels))Q=J.channels;else Q=[];for(const K of X){const Y=Q.find((j)=>j&&(String(j.name||j.title||j.text)===K||String(j.slug)===K));if(!Y||!Y.slug){const j=Q.map((Z)=>Z&&(Z.name||Z.title||Z.text)||"").filter(Boolean).join(" / ");return{ok:!1,stage:"channels",message:"思否上找不到频道「"+K+"」,可选:"+(j||"(频道列表为空)")}}T.push(Y.slug)}}let U="";if(V.cover){const Q=String(V.cover);if(Q.indexOf("/img/")===0)U=Q;else{let z;try{const Z=await fetch(Q,{credentials:"omit"});if(!Z.ok)return{ok:!1,stage:"cover",status:Z.status,message:"封面图下载失败(HTTP "+Z.status+"):"+Q.slice(0,120)};z=await Z.blob()}catch(Z){return{ok:!1,stage:"cover",message:"封面图下载失败("+String(Z&&Z.message||Z)+")。思否封面只收自家图床 /img/ 路径;建议 --cover 直接传本机图片路径,由命令自动转存"}}const J=new FormData;J.append("image",z);const K=await fetch("https://segmentfault.com/gateway/image",{method:"POST",credentials:"include",headers:{token:M},body:J}),Y=await K.text();let j;try{j=JSON.parse(Y)}catch(Z){return{ok:!1,stage:"cover",status:K.status,message:"封面图上传思否图床失败:"+Y.slice(0,120)}}U=j&&j.url||"";if(!U)return{ok:!1,stage:"cover",status:K.status,message:"封面图上传后未拿到 /img/ 路径:"+Y.slice(0,120)}}}const R={title:W.title,text:W.content,tags:F,blog_id:0,type:1};if(T.length>0)R.channel=T;if(U)R.cover=U;const q=await fetch("https://segmentfault.com/gateway/article",{method:"POST",credentials:"include",headers:E,body:JSON.stringify(R)}),L=await q.text();if(L==="Unauthorized"||L.includes("禁言")||L.includes("锁定"))return{ok:!1,stage:"publish",status:q.status,message:L==="Unauthorized"?"未授权,请检查登录态":L};let G;try{G=JSON.parse(L)}catch(Q){return{ok:!1,stage:"publish",status:q.status,message:"解析发布响应失败:"+L.slice(0,200)}}if(G&&(G.isError||G.error||G.errno||G.scene_id)){let Q=G.message||G.msg||G.error||"";if(G.scene_id)Q=(Q?Q+";":"")+"思否要求人机验证(geetest),无法在自动化环境完成";return{ok:!1,stage:"publish",status:q.status,message:Q||"发布失败:"+L.slice(0,200)}}const y=G&&G.data&&G.data.id;if(y==null)return{ok:!1,stage:"publish",status:q.status,message:G&&(G.message||G.msg)||"发布响应缺少文章 id:"+L.slice(0,200)};return{ok:!0,draft:!1,id:String(y),url:"https://segmentfault.com/a/"+y}}};v({site:"segmentfault",name:"article",access:"write",description:"发布文章到思否(SegmentFault)。默认正式发布,加 --draft 仅存草稿。正文默认 Markdown;外链图片自动转存到思否图床。正式发布必须指定标签(--tags),合法标签用 `segmentfault tags <名称>` 校验、频道用 `segmentfault channels` 列举。",domain:"segmentfault.com",strategy:p.COOKIE,browser:!0,args:[{name:"title",positional:!0,required:!0,help:"文章标题"},{name:"text",positional:!0,help:"文章正文(默认 Markdown;传 --html 则视为 HTML)"},{name:"file",help:"正文文件路径(UTF-8,默认 Markdown)"},{name:"html",type:"boolean",help:"将正文视为原始 HTML 而非 Markdown"},{name:"tags",help:"标签名,逗号分隔(正式发布必填,至少 1 个)。合法标签用 `segmentfault tags <名称>` 校验;草稿可省略。"},{name:"cover",help:"封面图(选填):本机图片路径或图片 URL,自动转存到思否图床。"},{name:"channels",help:"频道名,逗号分隔(选填)。合法值用 `segmentfault channels` 列举。"},{name:"draft",type:"boolean",help:"仅保存草稿,不正式发布"},{name:"execute",type:"boolean",help:"实际执行发布。不加此参数时命令拒绝写操作。"}],columns:["status","outcome","message","target_type","target","created_target","created_url"],func:async(W,H)=>{if(!W)throw new P("思否发布需要浏览器会话");u(H);const V=String(H.title??"").trim();if(!V)throw new N("INVALID_INPUT","文章标题不能为空");const B=await h(H),A=Boolean(H.draft),M=(U)=>typeof U==="string"?U.split(",").map((R)=>R.trim()).filter(Boolean):[],O=M(H.tags),b=M(H.channels),E=typeof H.cover==="string"?H.cover.trim():"";if(!A&&O.length===0)throw new N("INVALID_INPUT","思否正式发布必须指定 --tags(至少 1 个标签);合法标签用 `segmentfault tags <名称>` 校验,或加 --draft 只存草稿");const _=await f(W,{title:V,body:B,format:H.html?"html":"markdown",draftOnly:A,profile:segmentfaultProfile,publishParams:{tags:O,channels:b,cover:E}}),F=_.images.uploaded.length|0,X=_.images.failed.length|0;let T=_.draft?"已保存到思否草稿箱(需在网页上手动发布)":"已正式发布到思否";if(F||X)T+=`;图片:${F} 张转存成功${X?`,${X} 张失败`:""}`;return x(T,"article","",_.draft?"draft":"created",{created_target:(_.draft?"draft:":"article:")+_.id,created_url:_.url})}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as H,Strategy as K}from"@jackwener/opencli/registry";import{CommandExecutionError as A}from"@jackwener/opencli/errors";import{gotoWritePage as L}from"../_shared/article/publish.js";import{segmentfaultProfile as M}from"./article.js";import{SF_SIGNED_GET_JS as O}from"./_signed-request.js";H({site:"segmentfault",name:"channels",access:"read",description:"列出思否文章频道(名称 + slug),供 `segmentfault article --channels` 取合法频道名。",domain:"segmentfault.com",strategy:K.COOKIE,browser:!0,columns:["channel_slug","channel_name"],func:async(z)=>{if(!z)throw new A("思否频道列举需要浏览器会话");await L(z,M.home);const B="(async () => {"+O+'const res = await __sfSignedGet("/channels");if (res && res.__sfErr) return { __error: res.__sfErr };'+'let d; try { d = JSON.parse(res.raw); } catch (e) { return { __error: "解析频道响应失败(HTTP " + res.status + "):" + String(res.raw).slice(0, 200) }; }'+'if (res.status !== 200 || typeof d === "string") return { __error: "思否频道接口请求被拒(HTTP " + res.status + "):" + (typeof d === "string" ? d : String(res.raw).slice(0, 120)) };'+'let list = [];if (Array.isArray(d)) list = d;else if (d && Array.isArray(d.rows)) list = d.rows;else if (d && Array.isArray(d.data)) list = d.data;else if (d && Array.isArray(d.channels)) list = d.channels;return list.map((c) => ({ channel_slug: String((c && c.slug) || ""), channel_name: String((c && (c.name || c.title || c.text)) || "") }));})()',v=await z.evaluate(B);if(v&&v.__error)throw new A(v.__error);return Array.isArray(v)?v:[]}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{registerArticleLogin as k}from"../_shared/article/login.js";import{authProfile as b}from"./whoami.js";k({site:"segmentfault",domain:"segmentfault.com",profile:{home:b.home,checkAuth:b.checkAuth},loginDescription:"打开思否(SegmentFault)登录页并等待浏览器完成登录(供桌面客户端引导登录)。"});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import{cli as J,Strategy as K}from"@jackwener/opencli/registry";J({site:"segmentfault",name:"stats",access:"read",description:"思否文章数据(每篇阅读/独立访客/得票/评论/收藏/预计阅读时长等全量运营指标)",domain:"segmentfault.com",strategy:K.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"limit",type:"number",default:20,help:"返回条数"},{name:"user",help:"指定思否用户名(/u/<name> 里的 name),默认当前登录账号"}],columns:["id","type","title","url","published_at","views","likes","comments","collects","shares","unique_views","read_time","status","tags","extra"],func:async(D,C)=>{const G=Math.max(1,Number(C.limit)||20),H=typeof C.user==="string"?C.user.trim():"";await D.goto("https://segmentfault.com/");const q=await D.evaluate(`(async () => {
|
|
2
|
+
try {
|
|
3
|
+
if (!location.host.includes('segmentfault.com')) {
|
|
4
|
+
return { error: '当前标签不在思否域名(' + location.host + '),浏览器会话异常,请重试' };
|
|
5
|
+
}
|
|
6
|
+
const limit = ${JSON.stringify(G)};
|
|
7
|
+
let user = ${JSON.stringify(H)};
|
|
8
|
+
|
|
9
|
+
// ── 解析当前登录用户名(与 segmentfault whoami 同源:/user/settings HTML)──
|
|
10
|
+
if (!user) {
|
|
11
|
+
const res = await fetch('https://segmentfault.com/user/settings', { credentials: 'include' });
|
|
12
|
+
const html = await res.text();
|
|
13
|
+
const m = html.match(/href="\\/u\\/([^"]+)"/);
|
|
14
|
+
if (!m) {
|
|
15
|
+
return { error: '未登录思否:请先在 Chrome 里登录 segmentfault.com 再运行 segmentfault stats' };
|
|
16
|
+
}
|
|
17
|
+
user = m[1];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// ── 拉文章清单(个人主页文章 tab,SSR,每页 20 条)──────────────────
|
|
21
|
+
const ids = [];
|
|
22
|
+
const maxPages = Math.min(50, Math.ceil(limit / 20) + 1);
|
|
23
|
+
for (let p = 1; p <= maxPages && ids.length < limit; p++) {
|
|
24
|
+
const lr = await fetch('https://segmentfault.com/u/' + encodeURIComponent(user) + '/articles?sort=newest&page=' + p, { credentials: 'include' });
|
|
25
|
+
if (lr.status === 404) {
|
|
26
|
+
return { error: '思否上不存在用户「' + user + '」(个人主页 404)' };
|
|
27
|
+
}
|
|
28
|
+
if (!lr.ok) {
|
|
29
|
+
return { error: '拉取思否文章列表失败:HTTP ' + lr.status + '(第 ' + p + ' 页)' };
|
|
30
|
+
}
|
|
31
|
+
const lhtml = await lr.text();
|
|
32
|
+
const batch = [...lhtml.matchAll(/<h5[^>]*><a href="\\/a\\/(\\d+)"/g)].map((x) => x[1]);
|
|
33
|
+
if (batch.length === 0) break;
|
|
34
|
+
for (const id of batch) { if (!ids.includes(id)) ids.push(id); }
|
|
35
|
+
if (batch.length < 20) break;
|
|
36
|
+
}
|
|
37
|
+
if (ids.length === 0) {
|
|
38
|
+
return { error: '思否账号「' + user + '」还没有任何已发布文章(个人主页文章 tab 为空)' };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// ── 逐篇取详情页 __NEXT_DATA__,提取全量指标 ─────────────────────
|
|
42
|
+
const items = [];
|
|
43
|
+
for (const id of ids.slice(0, limit)) {
|
|
44
|
+
try {
|
|
45
|
+
const ar = await fetch('https://segmentfault.com/a/' + id, { credentials: 'include' });
|
|
46
|
+
if (!ar.ok) { items.push({ id, detail_error: 'HTTP ' + ar.status }); continue; }
|
|
47
|
+
const ahtml = await ar.text();
|
|
48
|
+
const dm = ahtml.match(/<script id="__NEXT_DATA__"[^>]*>([\\s\\S]*?)<\\/script>/);
|
|
49
|
+
if (!dm) { items.push({ id, detail_error: '详情页缺少 __NEXT_DATA__' }); continue; }
|
|
50
|
+
const nd = JSON.parse(dm[1]);
|
|
51
|
+
const detail = nd && nd.props && nd.props.pageProps && nd.props.pageProps.initialState
|
|
52
|
+
&& nd.props.pageProps.initialState.articleDetail
|
|
53
|
+
&& nd.props.pageProps.initialState.articleDetail.artDetail;
|
|
54
|
+
const art = detail && detail[id] && detail[id].article;
|
|
55
|
+
if (!art) { items.push({ id, detail_error: '详情数据里找不到文章对象' }); continue; }
|
|
56
|
+
items.push({ id, art: {
|
|
57
|
+
title: art.title,
|
|
58
|
+
created: art.created,
|
|
59
|
+
modified: art.modified,
|
|
60
|
+
real_views: art.real_views,
|
|
61
|
+
real_unique_views: art.real_unique_views,
|
|
62
|
+
votes: art.votes,
|
|
63
|
+
bookmarks: art.bookmarks,
|
|
64
|
+
comments: art.comments,
|
|
65
|
+
read_time: art.read_time,
|
|
66
|
+
status_key: art.status_key,
|
|
67
|
+
is_sticky: art.is_sticky,
|
|
68
|
+
is_edited: art.is_edited,
|
|
69
|
+
ip_address: art.ip_address,
|
|
70
|
+
article_type: art.article_type,
|
|
71
|
+
origin_url: art.origin_url,
|
|
72
|
+
tags: (art.tags || []).map((t) => (t && (t.name || t.title)) || '').filter(Boolean),
|
|
73
|
+
} });
|
|
74
|
+
} catch (e) {
|
|
75
|
+
items.push({ id, detail_error: String((e && e.message) || e) });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return { user, items };
|
|
79
|
+
} catch (e) {
|
|
80
|
+
return { error: String((e && e.message) || e) };
|
|
81
|
+
}
|
|
82
|
+
})()`);if(!q||q.error)throw Error(q?.error||"segmentfault stats:evaluate 无返回(浏览器会话异常)");const E=Array.isArray(q.items)?q.items:[];if(E.length===0)throw Error("segmentfault stats:未取到任何文章数据(浏览器会话异常,请重试)");const F=(h)=>{const b=Number(h);if(!Number.isFinite(b)||b<=0)return"";const z=new Date(b*1000+28800000),B=(I)=>String(I).padStart(2,"0");return`${z.getUTCFullYear()}-${B(z.getUTCMonth()+1)}-${B(z.getUTCDate())} ${B(z.getUTCHours())}:${B(z.getUTCMinutes())}`};return E.map((h)=>{const b=h.art;if(!b)return{id:h.id,type:"article",title:"",url:`https://segmentfault.com/a/${h.id}`,published_at:"",views:"",likes:"",comments:"",collects:"",shares:"",unique_views:"",read_time:"",status:"",tags:"",extra:JSON.stringify({detail_error:h.detail_error||"未知错误"})};return{id:h.id,type:"article",title:b.title||"",url:`https://segmentfault.com/a/${h.id}`,published_at:F(b.created),views:b.real_views??0,likes:b.votes??0,comments:b.comments??0,collects:b.bookmarks??0,shares:"",unique_views:b.real_unique_views??0,read_time:b.read_time??"",status:b.status_key||"",tags:(b.tags||[]).join("|"),extra:JSON.stringify({updated_at:F(b.modified),is_sticky:b.is_sticky,is_edited:b.is_edited,ip_address:b.ip_address||"",article_type:b.article_type,origin_url:b.origin_url||""})}})}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as L,Strategy as M}from"@jackwener/opencli/registry";import{CliError as O,CommandExecutionError as B}from"@jackwener/opencli/errors";import{gotoWritePage as Q}from"../_shared/article/publish.js";import{segmentfaultProfile as R}from"./article.js";import{SF_SIGNED_GET_JS as U}from"./_signed-request.js";L({site:"segmentfault",name:"tags",access:"read",description:"按名称校验思否标签是否存在并返回其真实 id,供 `segmentfault article --tags` 取合法标签。思否发文强制选标签,禁止臆造标签名/id。",domain:"segmentfault.com",strategy:M.COOKIE,browser:!0,args:[{name:"name",positional:!0,required:!0,help:"要校验的标签名(精确匹配,如 JavaScript / Vue.js)"}],columns:["exists","tag_id","tag_name"],func:async(z,H)=>{if(!z)throw new B("思否标签校验需要浏览器会话");const A=String(H.name??"").trim();if(!A)throw new O("INVALID_INPUT","标签名不能为空");await Q(z,R.home);const K="(async () => {"+U+"const name = "+JSON.stringify(A)+';const res = await __sfSignedGet("/tag/" + encodeURIComponent(name));if (res && res.__sfErr) return { __error: res.__sfErr };'+'let d; try { d = JSON.parse(res.raw); } catch (e) { return { __error: "解析标签响应失败(HTTP " + res.status + "):" + String(res.raw).slice(0, 200) }; }'+'if (res.status !== 200 || typeof d === "string") return { __error: "思否标签接口请求被拒(HTTP " + res.status + "):" + (typeof d === "string" ? d : String(res.raw).slice(0, 120)) };'+'const tag = d && d.tag;if (!tag || tag.id == null) return [{ exists: false, tag_id: "", tag_name: name }];return [{ exists: true, tag_id: String(tag.id), tag_name: String(tag.name || name) }];})()',v=await z.evaluate(K);if(v&&v.__error)throw new B(v.__error);return Array.isArray(v)?v:[]}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as E,Strategy as F}from"@jackwener/opencli/registry";import{checkLogin as G,cookieQuickCheck as H}from"../_shared/article/auth.js";import{segmentfaultProfile as I}from"./article.js";const authProfile={home:I.home,checkAuth:async(q)=>{const x=await(await fetch("https://segmentfault.com/user/settings",{credentials:"include"})).text(),z=x.match(/href="\/u\/([^"]+)"/);if(!z)return{isAuthenticated:!1,error:"未登录或无法解析用户信息"};const A=z[1],B=x.match(/src="(https:\/\/avatar-static\.segmentfault\.com\/[^"]+)"/),D=B?B[1]:"";return{isAuthenticated:!0,userId:A,username:A,avatar:D}}};export{authProfile};E({site:"segmentfault",name:"whoami",access:"read",description:"检查思否(SegmentFault)的登录状态并获取当前账号信息",domain:"segmentfault.com",strategy:F.COOKIE,browser:!0,columns:["logged_in","user_id","username"],authStatus:{quickCheck:H("https://segmentfault.com",["PHPSESSID"])},func:async(q)=>{const b=await G(q,authProfile);return[{logged_in:b.isAuthenticated,user_id:b.userId,username:b.username}]}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as m,Strategy as d}from"@jackwener/opencli/registry";import{ArgumentError as s,CommandExecutionError as c,EmptyResultError as h}from"@jackwener/opencli/errors";import{S2_GRAPH_BASE as u,normalizePaperRow as g,requireBoundedInt as w,requirePaperRef as y,s2Fetch as I}from"./utils.js";const S=["paperId","title","year","authors","citationCount","externalIds"].join(",");m({site:"semanticscholar",name:"citations",access:"read",description:"List papers that cite a Semantic Scholar paper (paginated)",domain:"api.semanticscholar.org",strategy:d.PUBLIC,browser:!1,args:[{name:"id",positional:!0,required:!0,help:"paperId (40-char hex), DOI, arXiv id, or prefixed id"},{name:"limit",type:"int",default:20,help:"Max citing papers (1-1000, single Semantic Scholar page)"},{name:"offset",type:"int",default:0,help:"Page offset (0-based)"}],columns:["rank","paperId","doi","title","year","firstAuthor","citationCount","url"],func:async(e)=>{const p=y(e.id),n=w(e.limit,20,1000),a=e.offset??0,t=typeof a==="number"?a:Number(a);if(!Number.isInteger(t)||t<0)throw new s("semanticscholar citations offset must be a non-negative integer");if(t>9999)throw new s("semanticscholar citations offset must be <= 9999");const l=`${u}/paper/${encodeURIComponent(p)}/citations?fields=${S}&limit=${n}&offset=${t}`,o=await I(l,"semanticscholar citations"),r=Array.isArray(o?.data)?o.data:null;if(r===null)throw new c("semanticscholar citations returned an unexpected payload shape");if(!r.length)throw new h("semanticscholar citations",`No Semantic Scholar citations for "${e.id}" at offset ${t}.`);return r.slice(0,n).map((i,f)=>{if(!i||typeof i!=="object"||!("citingPaper"in i))throw new c("semanticscholar citations row is missing citingPaper");return g(i.citingPaper,"citations",{rank:t+f+1})})}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as n,Strategy as o}from"@jackwener/opencli/registry";import{CommandExecutionError as p}from"@jackwener/opencli/errors";import{S2_GRAPH_BASE as l,normalizePaperRow as c,optionalNumber as t,requirePaperRef as s,s2Fetch as u,tldrText as d}from"./utils.js";const f=["paperId","title","year","authors","citationCount","influentialCitationCount","referenceCount","tldr","externalIds","url"].join(",");n({site:"semanticscholar",name:"paper",access:"read",description:"Semantic Scholar paper detail (citation graph + AI tldr) by paperId, DOI, or arXiv id",domain:"api.semanticscholar.org",strategy:o.PUBLIC,browser:!1,args:[{name:"id",positional:!0,required:!0,help:'paperId (40-char hex), DOI, arXiv id, or prefixed id (e.g. "ARXIV:1706.03762", "PMID:12345")'}],columns:["paperId","doi","title","year","firstAuthor","citationCount","influentialCitationCount","referenceCount","tldr","url"],func:async(r)=>{const a=s(r.id),i=`${l}/paper/${encodeURIComponent(a)}?fields=${f}`,e=await u(i,"semanticscholar paper");if(!e||typeof e!=="object")throw new p("semanticscholar paper returned an unexpected payload shape");return[{...c(e,"paper"),influentialCitationCount:t(e.influentialCitationCount,"paper influentialCitationCount"),referenceCount:t(e.referenceCount,"paper referenceCount"),tldr:d(e.tldr)}]}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as c,Strategy as m}from"@jackwener/opencli/registry";import{CommandExecutionError as d,EmptyResultError as p}from"@jackwener/opencli/errors";import{S2_REC_BASE as l,normalizePaperRow as h,requireBoundedInt as u,requirePaperRef as f,s2Fetch as I}from"./utils.js";const S=["paperId","title","year","authors","citationCount","externalIds"].join(",");c({site:"semanticscholar",name:"recommendations",access:"read",description:"Semantic Scholar AI-curated related papers for a paperId, DOI, or arXiv id",domain:"api.semanticscholar.org",strategy:m.PUBLIC,browser:!1,args:[{name:"id",positional:!0,required:!0,help:"paperId (40-char hex), DOI, arXiv id, or prefixed id"},{name:"limit",type:"int",default:10,help:"Max recommendations (1-500)"}],columns:["rank","paperId","doi","title","year","firstAuthor","citationCount","url"],func:async(e)=>{const o=f(e.id),a=u(e.limit,10,500),i=`${l}/papers/forpaper/${encodeURIComponent(o)}?fields=${S}&limit=${a}`,t=await I(i,"semanticscholar recommendations"),r=Array.isArray(t?.recommendedPapers)?t.recommendedPapers:null;if(r===null)throw new d("semanticscholar recommendations returned an unexpected payload shape");if(!r.length)throw new p("semanticscholar recommendations",`No Semantic Scholar recommendations for "${e.id}".`);return r.slice(0,a).map((n,s)=>h(n,"recommendations",{rank:s+1}))}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as c,Strategy as l}from"@jackwener/opencli/registry";import{CommandExecutionError as p,EmptyResultError as h}from"@jackwener/opencli/errors";import{S2_GRAPH_BASE as u,normalizePaperRow as m,requireBoundedInt as d,requireString as y,s2Fetch as f}from"./utils.js";const S=["paperId","title","year","authors","citationCount","externalIds"].join(",");c({site:"semanticscholar",name:"search",access:"read",description:"Search Semantic Scholar papers by free text",domain:"api.semanticscholar.org",strategy:l.PUBLIC,browser:!1,args:[{name:"query",positional:!0,required:!0,help:'Search text (e.g. "attention is all you need", "diffusion model")'},{name:"limit",type:"int",default:20,help:"Max papers (1-100, single Semantic Scholar page)"}],columns:["rank","paperId","doi","title","year","firstAuthor","citationCount","url"],func:async(r)=>{const t=y(r.query,"query"),a=d(r.limit,20,100),n=`${u}/paper/search?query=${encodeURIComponent(t)}&limit=${a}&fields=${S}`,i=await f(n,"semanticscholar search"),e=Array.isArray(i?.data)?i.data:null;if(e===null)throw new p("semanticscholar search returned an unexpected payload shape");if(!e.length)throw new h("semanticscholar search",`No Semantic Scholar papers matched "${t}".`);return e.slice(0,a).map((o,s)=>m(o,"search",{rank:s+1}))}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ArgumentError as j,CommandExecutionError as T,EmptyResultError as G}from"@jackwener/opencli/errors";export const S2_GRAPH_BASE="https://api.semanticscholar.org/graph/v1",S2_REC_BASE="https://api.semanticscholar.org/recommendations/v1";const L="opencli-semanticscholar-adapter (+https://github.com/jackwener/opencli)",M=/^[0-9a-f]{40}$/i,F=/^10\.\S+$/,Y=/^\d{4}\.\d{4,5}(?:v\d+)?$/,S=/^[a-z-]+\/\d{7}(?:v\d+)?$/i,B=/^(ARXIV|MAG|ACL|PMID|PMCID|URL|CorpusId|DBLP):/i;export function requireString(q,z){const H=String(q??"").trim();if(!H)throw new j(`semanticscholar ${z} cannot be empty`);return H}export function requireBoundedInt(q,z,H,Q="limit"){const J=q??z,W=typeof J==="number"?J:Number(J);if(!Number.isInteger(W)||W<=0)throw new j(`semanticscholar ${Q} must be a positive integer`);if(W>H)throw new j(`semanticscholar ${Q} must be <= ${H}`);return W}export function requirePaperRef(q){const z=String(q??"").trim();if(!z)throw new j("semanticscholar paper id cannot be empty","Example: opencli semanticscholar paper 10.18653/v1/N19-1423");const H=z.match(/^https?:\/\/(?:www\.)?semanticscholar\.org\/paper\/(?:[^/]+\/)?([0-9a-f]{40})/i);if(H)return H[1].toLowerCase();if(M.test(z))return z.toLowerCase();if(B.test(z))return z;if(/^doi:/i.test(z)){const J=z.replace(/^doi:/i,"").trim();if(F.test(J))return`DOI:${J}`}const Q=z.match(/^https?:\/\/(?:dx\.)?doi\.org\/(.+)$/i);if(Q&&F.test(Q[1]))return`DOI:${Q[1]}`;if(F.test(z))return`DOI:${z}`;if(Y.test(z)||S.test(z))return`ARXIV:${z}`;throw new j(`semanticscholar paper id "${q}" is not recognised`,'Use a Semantic Scholar paperId, a DOI, an arXiv id, or a prefixed id (e.g. "ARXIV:1706.03762", "PMID:12345").')}export async function s2Fetch(q,z){const H={"user-agent":L,accept:"application/json"},Q=process.env.SEMANTIC_SCHOLAR_API_KEY;if(Q)H["x-api-key"]=Q;let J,W=0;while(!0){try{J=await fetch(q,{headers:H})}catch(Z){throw new T(`${z} request failed: ${Z?.message??Z}`,"Check that api.semanticscholar.org is reachable from this network.")}if(J.status===429&&W===0&&!Q){W+=1;await new Promise((Z)=>setTimeout(Z,1500));continue}break}if(J.status===404)throw new G(z,`Semantic Scholar returned 404 for ${q}.`);if(J.status===429)throw new T(`${z} returned HTTP 429 (rate limited)`,"Semantic Scholar throttles anonymous traffic; set SEMANTIC_SCHOLAR_API_KEY (free at https://www.semanticscholar.org/product/api) or wait a minute and retry.");if(!J.ok)throw new T(`${z} returned HTTP ${J.status}`);let $;try{$=await J.json()}catch(Z){throw new T(`${z} returned malformed JSON: ${Z?.message??Z}`)}if($&&typeof $==="object"&&$.error)throw new T(`${z} returned an error: ${$.error}`);return $}export function tldrText(q){if(q&&typeof q==="object"&&typeof q.text==="string")return q.text.trim();return""}export function firstAuthorName(q){if(!Array.isArray(q)||!q.length)return"";const z=q[0];if(z&&typeof z==="object"&&typeof z.name==="string")return z.name.trim();return""}export function optionalNumber(q,z){if(q==null)return null;if(typeof q!=="number"||!Number.isFinite(q))throw new T(`semanticscholar ${z} must be a number when present`);return q}export function normalizePaperRow(q,z,{rank:H}={}){if(!q||typeof q!=="object")throw new T(`semanticscholar ${z} row is not an object`);if(typeof q.paperId!=="string"||!q.paperId.trim())throw new T(`semanticscholar ${z} row is missing paperId`);if(typeof q.title!=="string"||!q.title.trim())throw new T(`semanticscholar ${z} row is missing title`);if(q.authors!=null&&!Array.isArray(q.authors))throw new T(`semanticscholar ${z} row has malformed authors`);const Q={paperId:q.paperId.trim(),doi:pickDoi(q.externalIds),title:q.title.trim(),year:optionalNumber(q.year,`${z} year`),firstAuthor:firstAuthorName(q.authors),citationCount:optionalNumber(q.citationCount,`${z} citationCount`),url:typeof q.url==="string"&&q.url.trim()?q.url.trim():`https://www.semanticscholar.org/paper/${q.paperId.trim()}`};if(H!=null)return{rank:H,...Q};return Q}export function pickDoi(q){if(q&&typeof q==="object"&&typeof q.DOI==="string")return q.DOI;return""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as a,Strategy as e}from"@jackwener/opencli/registry";import{loadSinaBlogArticle as r}from"./utils.js";a({site:"sinablog",name:"article",access:"read",description:"获取新浪博客单篇文章详情",domain:"blog.sina.com.cn",strategy:e.COOKIE,args:[{name:"url",required:!0,positional:!0,help:"文章URL(如 https://blog.sina.com.cn/s/blog_xxx.html)"}],columns:["title","author","date","category","readCount","commentCount"],func:async(t,o)=>r(t,o.url)});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as i,Strategy as o}from"@jackwener/opencli/registry";import{loadSinaBlogHot as e}from"./utils.js";i({site:"sinablog",name:"hot",access:"read",description:"获取新浪博客热门文章/推荐",domain:"blog.sina.com.cn",strategy:o.COOKIE,args:[{name:"limit",type:"int",default:20,help:"返回的文章数量"}],columns:["rank","title","author","date","readCount","url"],func:async(t,a)=>e(t,Number(a.limit)||20)});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as o,Strategy as l}from"@jackwener/opencli/registry";function t(r){return typeof r==="string"?r.replace(/\s+/g," ").trim():""}function h(r){return r.replace(/<[^>]+>/g,"")}async function m(r,i){const s=new URL("https://search.sina.com.cn/api/search");s.searchParams.set("q",r);s.searchParams.set("tp","mix");s.searchParams.set("sort","0");s.searchParams.set("page","1");s.searchParams.set("size",String(Math.max(i,10)));s.searchParams.set("from","search_result");const e=await fetch(s,{headers:{"User-Agent":"Mozilla/5.0",Accept:"application/json"}});if(!e.ok)throw Error(`Sina blog search failed: HTTP ${e.status}`);const n=await e.json();return(Array.isArray(n?.data?.list)?n.data.list:[]).filter((a)=>t(a?.url).includes("blog.sina.com.cn/s/blog_")).slice(0,i).map((a,c)=>({rank:c+1,title:t(h(a?.title||"")),author:t(a?.media_show||a?.author),date:t(a?.time||a?.dataTime),description:t(a?.intro||a?.searchSummary).slice(0,150),url:t(a?.url)}))}o({site:"sinablog",name:"search",access:"read",description:"搜索新浪博客文章(通过新浪搜索)",domain:"blog.sina.com.cn",strategy:l.PUBLIC,browser:!1,args:[{name:"keyword",required:!0,positional:!0,help:"搜索关键词"},{name:"limit",type:"int",default:20,help:"返回的文章数量"}],columns:["rank","title","author","date","description","url"],func:async(r)=>m(r.keyword,Math.max(1,Math.min(Number(r.limit)||20,50)))});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as t,Strategy as a}from"@jackwener/opencli/registry";import{loadSinaBlogUser as r}from"./utils.js";t({site:"sinablog",name:"user",access:"read",description:"获取新浪博客用户的文章列表",domain:"blog.sina.com.cn",strategy:a.COOKIE,args:[{name:"uid",required:!0,positional:!0,help:"新浪博客用户ID(如 1234567890)"},{name:"limit",type:"int",default:20,help:"返回的文章数量"}],columns:["rank","title","author","date","readCount","url"],func:async(i,e)=>r(i,e.uid,Number(e.limit)||20)});
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import{clamp as l}from"../_shared/common.js";const i=(t)=>l(t||20,1,50);export function buildSinaBlogSearchUrl(t){return`https://search.sina.com.cn/search?q=${encodeURIComponent(t)}&tp=mix`}export function buildSinaBlogUserUrl(t){return`https://blog.sina.com.cn/s/articlelist_${encodeURIComponent(t)}_0_1.html`}export async function loadSinaBlogArticle(t,e){await t.goto(e);await t.wait({selector:"h1",timeout:3});return t.evaluate(`
|
|
2
|
+
(async () => {
|
|
3
|
+
await new Promise((resolve) => setTimeout(resolve, 1500));
|
|
4
|
+
const normalize = (value) => (value || '').replace(/\\s+/g, ' ').trim();
|
|
5
|
+
const title = normalize(document.querySelector('.articalTitle h2, .title h2, h1, h2.titName')?.textContent);
|
|
6
|
+
const titleParts = normalize(document.title).split('_').map((part) => normalize(part)).filter(Boolean);
|
|
7
|
+
const author = titleParts[1] || title.split(/[::]/)[0] || '';
|
|
8
|
+
const timeText = normalize(document.querySelector('.time, .articalInfo .time')?.textContent).replace(/[()]/g, '');
|
|
9
|
+
const date = timeText || normalize(document.body.innerText.match(/\\b\\d{4}-\\d{2}-\\d{2}(?:\\s+\\d{2}:\\d{2}:\\d{2})?\\b/)?.[0]);
|
|
10
|
+
const category = normalize(document.querySelector('.articalTag .blog_class a, .blog_class a')?.textContent);
|
|
11
|
+
const tags = Array.from(document.querySelectorAll('.blog_tag h3, .blog_tag a, .tag a, .artical_tag a'))
|
|
12
|
+
.map((node) => normalize(node.textContent))
|
|
13
|
+
.filter(Boolean);
|
|
14
|
+
const content = normalize(document.querySelector('.articalContent, .blog_content, .content, #sina_keyword_ad_area2')?.textContent).slice(0, 500);
|
|
15
|
+
const images = Array.from(document.querySelectorAll('.articalContent img, .blog_content img, .content img'))
|
|
16
|
+
.map((img) => img.getAttribute('src') || img.getAttribute('real_src') || '')
|
|
17
|
+
.filter((src) => src && !src.includes('icon'))
|
|
18
|
+
.slice(0, 5);
|
|
19
|
+
return {
|
|
20
|
+
title,
|
|
21
|
+
author,
|
|
22
|
+
date,
|
|
23
|
+
category,
|
|
24
|
+
tags: tags.join(', '),
|
|
25
|
+
readCount: '',
|
|
26
|
+
commentCount: '',
|
|
27
|
+
content: content + (content.length >= 500 ? '...' : ''),
|
|
28
|
+
images: images.join(', '),
|
|
29
|
+
url: ${JSON.stringify(e)},
|
|
30
|
+
};
|
|
31
|
+
})()
|
|
32
|
+
`)}export async function loadSinaBlogHot(t,e){const o=i(e);await t.goto("https://blog.sina.com.cn/");await t.wait({selector:"h1",timeout:3});const r=await t.evaluate(`
|
|
33
|
+
(async () => {
|
|
34
|
+
await new Promise((resolve) => setTimeout(resolve, 1500));
|
|
35
|
+
const normalize = (value) => (value || '').replace(/\\s+/g, ' ').trim();
|
|
36
|
+
const limit = ${o};
|
|
37
|
+
const abs = (href) => {
|
|
38
|
+
if (!href) return '';
|
|
39
|
+
if (href.startsWith('//')) return 'https:' + href;
|
|
40
|
+
if (href.startsWith('http')) return href;
|
|
41
|
+
return 'https://blog.sina.com.cn' + (href.startsWith('/') ? '' : '/') + href;
|
|
42
|
+
};
|
|
43
|
+
const parseArticle = (doc, fallback) => {
|
|
44
|
+
const title = normalize(doc.querySelector('.articalTitle h2, .title h2, h1, h2.titName')?.textContent) || fallback.title;
|
|
45
|
+
const titleParts = normalize(doc.title).split('_').map((part) => normalize(part)).filter(Boolean);
|
|
46
|
+
const timeText = normalize(doc.querySelector('.time, .articalInfo .time')?.textContent).replace(/[()]/g, '');
|
|
47
|
+
const articleId = fallback.url.match(/blog_([a-zA-Z0-9]+)\\.html/)?.[1] || '';
|
|
48
|
+
return {
|
|
49
|
+
articleId,
|
|
50
|
+
title,
|
|
51
|
+
author: titleParts[1] || title.split(/[::]/)[0] || '',
|
|
52
|
+
date: timeText || '',
|
|
53
|
+
readCount: '',
|
|
54
|
+
description: normalize(doc.querySelector('.articalContent, .blog_content, .content, #sina_keyword_ad_area2')?.textContent).slice(0, 150),
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const seeds = [];
|
|
59
|
+
const seen = new Set();
|
|
60
|
+
for (const link of Array.from(document.querySelectorAll('.day-hot-rank .art-list a[href*="/s/blog_"], .hot-rank .art-list a[href*="/s/blog_"]'))) {
|
|
61
|
+
const title = normalize(link.textContent);
|
|
62
|
+
const url = abs(link.getAttribute('href') || '');
|
|
63
|
+
if (!title || !url || seen.has(url)) continue;
|
|
64
|
+
seen.add(url);
|
|
65
|
+
seeds.push({ rank: seeds.length + 1, title, url });
|
|
66
|
+
if (seeds.length >= limit) break;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const results = [];
|
|
70
|
+
for (const item of seeds) {
|
|
71
|
+
let merged = {
|
|
72
|
+
rank: item.rank,
|
|
73
|
+
articleId: item.url.match(/blog_([a-zA-Z0-9]+)\\.html/)?.[1] || '',
|
|
74
|
+
title: item.title,
|
|
75
|
+
author: '',
|
|
76
|
+
date: '',
|
|
77
|
+
readCount: '',
|
|
78
|
+
description: '',
|
|
79
|
+
url: item.url,
|
|
80
|
+
};
|
|
81
|
+
try {
|
|
82
|
+
const resp = await fetch(item.url, { credentials: 'include' });
|
|
83
|
+
if (resp.ok) {
|
|
84
|
+
const html = await resp.text();
|
|
85
|
+
const doc = new DOMParser().parseFromString(html, 'text/html');
|
|
86
|
+
merged = Object.assign(merged, parseArticle(doc, item));
|
|
87
|
+
}
|
|
88
|
+
} catch {}
|
|
89
|
+
results.push(merged);
|
|
90
|
+
}
|
|
91
|
+
return results;
|
|
92
|
+
})()
|
|
93
|
+
`);return Array.isArray(r)?r:[]}export async function loadSinaBlogSearch(t,e,o){const r=i(o);await t.goto(buildSinaBlogSearchUrl(e));await t.wait({selector:".result-item",timeout:5});const n=await t.evaluate(`
|
|
94
|
+
(async () => {
|
|
95
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
96
|
+
for (let i = 0; i < 20; i += 1) {
|
|
97
|
+
if (document.querySelector('.result-item')) break;
|
|
98
|
+
await sleep(500);
|
|
99
|
+
}
|
|
100
|
+
const normalize = (value) => (value || '').replace(/\\s+/g, ' ').trim();
|
|
101
|
+
const limit = ${r};
|
|
102
|
+
const items = Array.from(document.querySelectorAll('.result-item'));
|
|
103
|
+
const results = [];
|
|
104
|
+
for (const item of items) {
|
|
105
|
+
const link = item.querySelector('.result-title a[href*="blog.sina.com.cn/s/blog_"]');
|
|
106
|
+
const title = normalize(link?.textContent);
|
|
107
|
+
const url = link?.getAttribute('href') || '';
|
|
108
|
+
if (!title || !url) continue;
|
|
109
|
+
results.push({
|
|
110
|
+
rank: results.length + 1,
|
|
111
|
+
title,
|
|
112
|
+
author: normalize(item.querySelector('.result-meta .source')?.textContent),
|
|
113
|
+
date: normalize(item.querySelector('.result-meta .time')?.textContent),
|
|
114
|
+
description: normalize(item.querySelector('.result-intro')?.textContent).slice(0, 150),
|
|
115
|
+
url,
|
|
116
|
+
});
|
|
117
|
+
if (results.length >= limit) break;
|
|
118
|
+
}
|
|
119
|
+
return results;
|
|
120
|
+
})()
|
|
121
|
+
`);return Array.isArray(n)?n:[]}export async function loadSinaBlogUser(t,e,o){const r=i(o);await t.goto(buildSinaBlogUserUrl(e));await t.wait({selector:"h1",timeout:3});const n=await t.evaluate(`
|
|
122
|
+
(async () => {
|
|
123
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
124
|
+
const normalize = (value) => (value || '').replace(/\\s+/g, ' ').trim();
|
|
125
|
+
const limit = ${r};
|
|
126
|
+
const author = normalize(document.title).split('_').map((part) => normalize(part)).filter(Boolean)[1] || '';
|
|
127
|
+
const abs = (href) => {
|
|
128
|
+
if (!href) return '';
|
|
129
|
+
if (href.startsWith('//')) return 'https:' + href;
|
|
130
|
+
if (href.startsWith('http')) return href;
|
|
131
|
+
return 'https://blog.sina.com.cn' + (href.startsWith('/') ? '' : '/') + href;
|
|
132
|
+
};
|
|
133
|
+
const results = [];
|
|
134
|
+
for (const item of Array.from(document.querySelectorAll('.articleList .articleCell'))) {
|
|
135
|
+
const link = item.querySelector('.atc_title a[href*="/s/blog_"]');
|
|
136
|
+
const title = normalize(link?.textContent);
|
|
137
|
+
const url = abs(link?.getAttribute('href') || '');
|
|
138
|
+
if (!title || !url) continue;
|
|
139
|
+
results.push({
|
|
140
|
+
rank: results.length + 1,
|
|
141
|
+
articleId: url.match(/blog_([a-zA-Z0-9]+)\\.html/)?.[1] || '',
|
|
142
|
+
title,
|
|
143
|
+
author,
|
|
144
|
+
date: normalize(item.querySelector('.atc_tm')?.textContent),
|
|
145
|
+
readCount: '',
|
|
146
|
+
description: '',
|
|
147
|
+
url,
|
|
148
|
+
});
|
|
149
|
+
if (results.length >= limit) break;
|
|
150
|
+
}
|
|
151
|
+
return results;
|
|
152
|
+
})()
|
|
153
|
+
`);return Array.isArray(n)?n:[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as F,Strategy as G}from"@jackwener/opencli/registry";import{CliError as v}from"@jackwener/opencli/errors";const J=[0,10,1,3,4,5,102,6,6,8];function K(b){return b.replace(/<[^>]+>/g,"").trim()}F({site:"sinafinance",name:"news",access:"read",description:"新浪财经 7x24 小时实时快讯",domain:"app.cj.sina.com.cn",strategy:G.PUBLIC,browser:!1,args:[{name:"limit",type:"int",default:20,help:"Max results (max 50)"},{name:"type",type:"int",default:0,help:"News type: 0=全部 1=A股 2=宏观 3=公司 4=数据 5=市场 6=国际 7=观点 8=央行 9=其它"}],columns:["id","time","content","views"],func:async(b)=>{const x=Math.max(1,Math.min(Number(b.limit),50)),z=J[b.type]??0,B=new URLSearchParams({page:"1",size:String(x),tag:String(z)}),q=await fetch(`https://app.cj.sina.com.cn/api/news/pc?${B}`);if(!q.ok)throw new v("FETCH_ERROR",`Sina Finance API HTTP ${q.status}`,"Check your network connection");const u=(await q.json())?.result?.data?.feed?.list??[];if(!u.length)throw new v("NOT_FOUND","No news found","Try a different type or increase limit");return u.map((d)=>({id:d.id??"",time:d.create_time??"",content:K(d.rich_text??""),views:d.view_num??0}))}});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{cli as l,Strategy as n}from"@jackwener/opencli/registry";l({site:"sinafinance",name:"rolling-news",access:"read",description:"新浪财经滚动新闻",domain:"finance.sina.com.cn/roll",strategy:n.COOKIE,args:[],columns:["column","title","date","url"],func:async(t,r)=>{await t.goto("https://finance.sina.com.cn/roll/#pageid=384&lid=2519");await t.wait({selector:".d_list_txt li",timeout:1e4});const e=await t.evaluate(`
|
|
2
|
+
(() => {
|
|
3
|
+
const cleanText = (value) => (value || '').replace(/\\s+/g, ' ').trim();
|
|
4
|
+
const results = [];
|
|
5
|
+
document.querySelectorAll('.d_list_txt li').forEach(el => {
|
|
6
|
+
const titleEl = el.querySelector('.c_tit a');
|
|
7
|
+
const columnEl = el.querySelector('.c_chl');
|
|
8
|
+
const dateEl = el.querySelector('.c_time');
|
|
9
|
+
const url = titleEl?.getAttribute('href') || '';
|
|
10
|
+
if (!url) return;
|
|
11
|
+
results.push({
|
|
12
|
+
title: cleanText(titleEl?.textContent || ''),
|
|
13
|
+
column: cleanText(columnEl?.textContent || ''),
|
|
14
|
+
date: cleanText(dateEl?.textContent || ''),
|
|
15
|
+
url: url,
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
return results;
|
|
19
|
+
})()
|
|
20
|
+
`);if(!Array.isArray(e))return[];return e}});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{cli as c,Strategy as r}from"@jackwener/opencli/registry";c({site:"sinafinance",name:"stock-rank",access:"read",description:"新浪财经热搜榜",domain:"finance.sina.cn",strategy:r.COOKIE,navigateBefore:!1,args:[{name:"market",type:"string",default:"cn",choices:["cn","hk","us","wh","ft"],help:"Market: cn (A股), hk (港股), us (美股), wh (外汇), ft (期货)"}],columns:["rank","name","symbol","market","price","change","url"],func:async(e,n)=>{const a=n.market||"cn";await e.goto("https://finance.sina.cn/");await e.wait({selector:"#actionSearch",timeout:1e4});const t=await e.evaluate(`
|
|
2
|
+
(async () => {
|
|
3
|
+
const wait = (ms) => new Promise(r => setTimeout(r, ms));
|
|
4
|
+
const cleanText = (value) => (value || '').replace(/\\s+/g, ' ').trim();
|
|
5
|
+
const marketType = ${JSON.stringify(a)};
|
|
6
|
+
|
|
7
|
+
const searchBtn = document.querySelector('#actionSearch');
|
|
8
|
+
if (searchBtn) {
|
|
9
|
+
searchBtn.dispatchEvent(new Event('tap', { bubbles: true }));
|
|
10
|
+
await wait(3000);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const tabEl = document.querySelector('[data-type="' + marketType + '"]');
|
|
14
|
+
const marketName = tabEl?.textContent || marketType;
|
|
15
|
+
if (marketType !== 'cn' && tabEl) {
|
|
16
|
+
tabEl.click();
|
|
17
|
+
await wait(2000);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const results = [];
|
|
21
|
+
document.querySelectorAll('#stock-list .j-stock-row').forEach(el => {
|
|
22
|
+
const rankEl = el.querySelector('.rank');
|
|
23
|
+
const nameEl = el.querySelector('.j-sname');
|
|
24
|
+
const codeEl = el.querySelector('.stock-code');
|
|
25
|
+
const priceEl = el.querySelector('.j-price');
|
|
26
|
+
const changeEl = el.querySelector('.j-change');
|
|
27
|
+
const openUrl = el.getAttribute('open-url') || '';
|
|
28
|
+
const fullUrl = openUrl ? 'https:' + openUrl : '';
|
|
29
|
+
results.push({
|
|
30
|
+
rank: cleanText(rankEl?.textContent || ''),
|
|
31
|
+
name: cleanText(nameEl?.textContent || ''),
|
|
32
|
+
symbol: cleanText(codeEl?.textContent || ''),
|
|
33
|
+
market: cleanText(marketName),
|
|
34
|
+
price: cleanText(priceEl?.textContent || ''),
|
|
35
|
+
change: cleanText(changeEl?.textContent || ''),
|
|
36
|
+
url: fullUrl,
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
return results;
|
|
40
|
+
})()
|
|
41
|
+
`);if(!Array.isArray(t))return[];return t}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as u,Strategy as v}from"@jackwener/opencli/registry";import{CliError as Y}from"@jackwener/opencli/errors";const L="11",Z="31",P="41";async function G(D){const z=await fetch(D,{headers:{Referer:"https://finance.sina.com.cn"}});if(!z.ok)throw new Y("FETCH_ERROR",`Sina API HTTP ${z.status}`,"Check your network");const J=await z.arrayBuffer();return new TextDecoder("gbk").decode(J)}function H(D,z){const J=D.match(/suggestvalue="(.*)"/s);if(!J)return[];return J[1].split(";").filter(Boolean).map((V)=>{const F=V.split(",");return{name:F[4]||F[0]||"",market:F[1]||"",symbol:F[3]||""}}).filter((V)=>z.includes(V.market))}function S(D){if(D.market===Z)return`hk${D.symbol}`;if(D.market===P)return`gb_${D.symbol}`;return D.symbol}function h(D,z){const J=z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),V=D.match(new RegExp(`hq_str_${J}="([^"]*)"`));return V?V[1].split(","):[]}function C(D){const z=parseFloat(D);if(!z)return"";if(z>=1000000000000)return(z/1000000000000).toFixed(2)+"T";if(z>=1e9)return(z/1e9).toFixed(2)+"B";if(z>=1e6)return(z/1e6).toFixed(2)+"M";return String(z)}u({site:"sinafinance",name:"stock",access:"read",description:"新浪财经行情(A股/港股/美股)",domain:"suggest3.sinajs.cn,hq.sinajs.cn",strategy:v.PUBLIC,browser:!1,args:[{name:"key",type:"string",required:!0,positional:!0,help:"Stock name or code (e.g. 贵州茅台, 腾讯控股, AAPL)"},{name:"market",type:"string",default:"auto",help:"Market: cn, hk, us, auto (default: auto searches cn → hk → us)"}],columns:["Symbol","Name","Price","Change","ChangePercent","Open","High","Low","Volume","MarketCap"],func:async(D)=>{const z=String(D.key),J=String(D.market),F={cn:[L],hk:[Z],us:[P],auto:[L,Z,P]}[J];if(!F)throw new Y("INPUT_ERROR",`Invalid market: "${J}"`,"Expected cn, hk, us, or auto");const q=await G(`https://suggest3.sinajs.cn/suggest/type=${F.join(",")}&key=${encodeURIComponent(z)}`),j=H(q,F);if(!j.length)throw new Y("NOT_FOUND",`No stock found for "${z}"`,"Try a different name, code, or --market");const W=z.toLowerCase(),B=(O)=>{const I=O.name.toLowerCase(),Q=O.symbol.toLowerCase();if(Q===W||I===W)return 1;if(Q.includes(W))return W.length/Q.length;if(I.includes(W))return W.length/I.length;return 0},X=j.sort((O,I)=>{const Q=B(I)-B(O);return Q!==0?Q:F.indexOf(O.market)-F.indexOf(I.market)})[0],$=S(X),N=await G(`https://hq.sinajs.cn/list=${$}`),x=h(N,$);if(x.length<2||!x[0])throw new Y("NOT_FOUND",`No quote data for "${z}"`,"Market may be closed or data unavailable");if(X.market===L){const O=parseFloat(x[3]),I=parseFloat(x[2]),Q=(O-I).toFixed(2),U=((O-I)/I*100).toFixed(2)+"%";return[{Symbol:$.toUpperCase(),Name:x[0],Price:x[3],Change:Q,ChangePercent:U,Open:x[1],High:x[4],Low:x[5],Volume:x[8],MarketCap:""}]}if(X.market===Z)return[{Symbol:X.symbol,Name:x[1],Price:x[2],Change:x[7],ChangePercent:x[8]+"%",Open:x[6],High:x[4],Low:x[5],Volume:x[11],MarketCap:""}];return[{Symbol:X.symbol.toUpperCase(),Name:x[0],Price:x[1],Change:x[4],ChangePercent:x[2]+"%",Open:x[6],High:x[8],Low:x[9],Volume:x[10],MarketCap:C(x[12])}]}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import $ from"node:fs";import F from"node:path";import{cli as H,Strategy as T}from"@jackwener/opencli/registry";import{ArgumentError as v,CommandExecutionError as J}from"@jackwener/opencli/errors";import{buildFetchSnippet as A}from"./in-page.js";import{dispatchEvaluateResult as D}from"./errors.js";import{SLOCK_SITE as M,SLOCK_DOMAIN as N,SLOCK_HOME_URL as b}from"./shared.js";import{UUID_RE as f}from"./resolve.js";H({site:M,name:"attachment-download",access:"read",description:"Download an attachment to a local file. Resolves a signed CDN URL in the page, then fetches bytes node-side (no CORS).",domain:N,strategy:T.COOKIE,browser:!0,siteSession:"persistent",args:[{name:"attachmentId",positional:!0,required:!0,help:"Attachment UUID"},{name:"out",help:"Local path to write to. Defaults to ./<attachmentId>.bin"},{name:"server",help:"Override active server slug"}],columns:["attachmentId","out","sizeBytes"],func:async(P,B)=>{const q=String(B.attachmentId??"").trim();if(!f.test(q))throw new v(`attachmentId "${q}" is not a UUID`);const Q=F.resolve(String(B.out??`./${q}.bin`));await P.goto(b);const X=A({method:"GET",path:`/attachments/${encodeURIComponent(q)}/url`,serverScoped:!0,serverIdOverride:B.server}),Y=await P.evaluate(`(async () => { ${X} })()`),G=D(Y),V=(Array.isArray(G)?G[0]:G)?.url;if(!V)throw new J(`no signed url returned for attachment ${q}`);let z;try{z=await fetch(V)}catch(Z){throw new J(`network error fetching signed URL: ${Z.message}`)}if(!z.ok)throw new J(`HTTP ${z.status} from signed CDN URL while downloading ${q}`);const W=await z.arrayBuffer();$.writeFileSync(Q,Buffer.from(W));return[{attachmentId:q,out:Q,sizeBytes:W.byteLength}]}});
|