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 @@
|
|
|
1
|
+
import{cli as i,Strategy as o}from"@jackwener/opencli/registry";import{listAddUser as n}from"./list-add-core.js";import{parseBatchIntervalSeconds as l,parseCommaSeparatedUsernames as m,runListBatch as d}from"./list-batch-utils.js";const u='Example: opencli twitter list-add-batch 123456789 "@alice,@bob" --interval 5';i({site:"twitter",name:"list-add-batch",access:"write",description:"Add multiple users to a Twitter/X list you own from a comma-separated username list",domain:"x.com",strategy:o.UI,browser:!0,args:[{name:"listId",positional:!0,type:"string",required:!0,help:"Numeric ID of the list you own (e.g. from `opencli twitter lists`)"},{name:"usernames",positional:!0,type:"string",required:!0,help:"Comma-separated Twitter/X handles to add (with or without @)"},{name:"interval",type:"int",default:5,help:"Seconds to wait between account additions (default: 5)"},{name:"timeout",type:"int",default:600,help:"Max seconds for the overall batch command (default: 600)"}],columns:["listId","username","userId","status","message"],func:async(e,t)=>{const a=String(t.listId||"").trim(),r=m(t.usernames,u),s=l(t.interval);return d({page:e,listId:a,usernames:r,interval:s,operation:n})}});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import{ArgumentError as U,AuthRequiredError as w,CommandExecutionError as X}from"@jackwener/opencli/errors";import{resolveTwitterQueryId as Y,unwrapBrowserResult as x}from"./shared.js";import{parseListsManagement as B}from"./lists.js";import{TWITTER_BEARER_TOKEN as A}from"./utils.js";const c="IGgvgiOx4QZndDHuD3x9TQ",f="78UbkyXwXBD98IgUWXOy9g",T="vWPi0CTMoPFsjsL6W4IynQ",b={rweb_video_screen_enabled:!1,profile_label_improvements_pcf_label_in_post_enabled:!0,rweb_tipjar_consumption_enabled:!0,verified_phone_label_enabled:!1,creator_subscriptions_tweet_preview_api_enabled:!0,responsive_web_graphql_timeline_navigation_enabled:!0,responsive_web_graphql_skip_user_profile_image_extensions_enabled:!1,premium_content_api_read_enabled:!1,communities_web_enable_tweet_community_results_fetch:!0,c9s_tweet_anatomy_moderator_badge_enabled:!0,responsive_web_grok_analyze_button_fetch_trends_enabled:!1,responsive_web_grok_analyze_post_followups_enabled:!0,responsive_web_jetfuel_frame:!1,responsive_web_grok_share_attachment_enabled:!0,articles_preview_enabled:!0,responsive_web_edit_tweet_api_enabled:!0,graphql_is_translatable_rweb_tweet_is_translatable_enabled:!0,view_counts_everywhere_api_enabled:!0,longform_notetweets_consumption_enabled:!0,responsive_web_twitter_article_tweet_consumption_enabled:!0,tweet_awards_web_tipping_enabled:!1,responsive_web_grok_show_grok_translated_post:!1,responsive_web_grok_analysis_button_from_backend:!1,creator_subscriptions_quote_tweet_preview_enabled:!1,freedom_of_speech_not_reach_fetch_enabled:!0,standardized_nudges_misinfo:!0,tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled:!0,longform_notetweets_rich_text_read_enabled:!0,longform_notetweets_inline_media_enabled:!0,responsive_web_grok_image_annotation_enabled:!0,responsive_web_enhance_cards_enabled:!1};function C(z,V){const H=JSON.stringify({screen_name:V,withSafetyModeUserFields:!0}),P=JSON.stringify({hidden_profile_subscriptions_enabled:!0,rweb_tipjar_consumption_enabled:!0,responsive_web_graphql_exclude_directive_enabled:!0,verified_phone_label_enabled:!1,subscriptions_verification_info_is_identity_verified_enabled:!0,subscriptions_verification_info_verified_since_enabled:!0,highlights_tweets_tab_ui_enabled:!0,responsive_web_twitter_article_notes_tab_enabled:!0,subscriptions_feature_can_gift_premium:!0,creator_subscriptions_tweet_preview_api_enabled:!0,responsive_web_graphql_skip_user_profile_image_extensions_enabled:!1,responsive_web_graphql_timeline_navigation_enabled:!0});return`/i/api/graphql/${z}/UserByScreenName?variables=${encodeURIComponent(H)}&features=${encodeURIComponent(P)}`}function g(z){return(Array.isArray(z)?z:[]).filter((H)=>!(H?.path||[]).join(".").includes("default_banner_media_results")&&!/decode/i.test(H?.message||""))}export function buildListAddMemberRow({addResult:z,memberCountBefore:V,listId:H,username:P,userId:v}){if(!z?.httpOk)throw new X(`Failed to add @${P} to list ${H}: HTTP ${z?.status??0}${z?.fetchError?" ("+z.fetchError+")":""}${z?.raw?" — "+z.raw:""}`);const O=z.mc!==null&&z.mc!==void 0,G=g(z.errors);if(!O&&G.length){const h=G.map((j)=>j.message||JSON.stringify(j)).join("; ");throw new X(`Failed to add @${P} to list ${H}: ${h.slice(0,300)}`)}if(!O)throw new X(`Failed to add @${P} to list ${H}: no member_count in response`);const Z=Number(z.mc);if(!Number.isFinite(Z))throw new X(`Failed to add @${P} to list ${H}: invalid member_count in response`);if(Z<V)throw new X(`Failed to add @${P} to list ${H}: member_count decreased unexpectedly (${V} → ${Z})`);const W=!(Z>V);if(W&&z.isMember!==!0)throw new X(`Failed to add @${P} to list ${H}: member_count unchanged and membership was not confirmed`);const J=`member_count ${V} → ${Z}`;return{listId:H,username:P,userId:String(v),status:W?"noop":"success",message:W?`@${P} is already a member of list ${H}`:`Added @${P} to list ${H} (verified via ${J})`}}export async function listAddUser(z,V){const H=String(V.listId||"").trim(),P=String(V.username||"").replace(/^@/,"").trim();if(!H||!/^\d+$/.test(H))throw new U(`Invalid listId: ${JSON.stringify(V.listId)}. Expected numeric ID.`,"Example: opencli twitter list-add 123456789 alice");if(!P)throw new U("twitter list-add username is required","Example: opencli twitter list-add 123456789 alice");await z.goto("https://x.com");await z.wait(3);const O=(await z.getCookies({url:"https://x.com"})).find((q)=>q.name==="ct0")?.value||null;if(!O)throw new w("x.com","Not logged into x.com (no ct0 cookie)");const G=await Y(z,"UserByScreenName",c),Z=JSON.stringify({Authorization:`Bearer ${decodeURIComponent(A)}`,"X-Csrf-Token":O,"X-Twitter-Auth-Type":"OAuth2Session","X-Twitter-Active-User":"yes"}),k=C(G,P),W=await z.evaluate(`async () => {
|
|
2
|
+
const resp = await fetch(${JSON.stringify(k)}, { headers: ${Z}, credentials: 'include' });
|
|
3
|
+
if (!resp.ok) return null;
|
|
4
|
+
const d = await resp.json();
|
|
5
|
+
return d.data?.user?.result?.rest_id || null;
|
|
6
|
+
}`),J=x(W);if(!J)throw new X(`Could not resolve user @${P}`);const j=`/i/api/graphql/${await Y(z,"ListsManagementPageTimeline",f)}/ListsManagementPageTimeline?features=${encodeURIComponent(JSON.stringify(b))}`,K=await z.evaluate(`async () => {
|
|
7
|
+
const r = await fetch(${JSON.stringify(j)}, { headers: ${Z}, credentials: 'include' });
|
|
8
|
+
if (!r.ok) return { __error: 'HTTP ' + r.status };
|
|
9
|
+
return await r.json();
|
|
10
|
+
}`),Q=K&&!K.__error?B(K,new Set):[];if(K&&K.__error)throw new X(`Could not fetch lists: ${K.__error}`);const L=Q.find((q)=>q.id===H);if(!L)throw new X(`List ${H} not found among your lists (${Q.length} lists fetched).`);const D=Number(L.members)||0,S=await Y(z,"ListAddMember",T),N=`/i/api/graphql/${S}/ListAddMember`,y=JSON.stringify({variables:{listId:H,userId:String(J)},queryId:S}),M=await z.evaluate(`async () => {
|
|
11
|
+
try {
|
|
12
|
+
const r = await fetch(${JSON.stringify(N)}, {
|
|
13
|
+
method: 'POST',
|
|
14
|
+
headers: Object.assign({}, ${Z}, { 'Content-Type': 'application/json' }),
|
|
15
|
+
credentials: 'include',
|
|
16
|
+
body: ${JSON.stringify(y)},
|
|
17
|
+
});
|
|
18
|
+
const text = await r.text();
|
|
19
|
+
let body;
|
|
20
|
+
let raw = null;
|
|
21
|
+
try { body = JSON.parse(text); } catch { body = null; raw = text.slice(0, 300); }
|
|
22
|
+
const list = body && body.data && body.data.list ? body.data.list : null;
|
|
23
|
+
return JSON.stringify([
|
|
24
|
+
r.ok,
|
|
25
|
+
r.status,
|
|
26
|
+
list ? list.member_count : null,
|
|
27
|
+
list ? list.is_member : null,
|
|
28
|
+
body && body.errors ? body.errors : null,
|
|
29
|
+
raw,
|
|
30
|
+
null,
|
|
31
|
+
]);
|
|
32
|
+
} catch (e) {
|
|
33
|
+
return JSON.stringify([false, 0, null, null, null, null, String(e)]);
|
|
34
|
+
}
|
|
35
|
+
}`),_=x(M);let $;try{$=JSON.parse(_)}catch{throw new X(`Failed to add @${P} to list ${H}: malformed mutation response envelope`)}const F=Object.create(null);F.httpOk=Boolean($?.[0]);F.status=Number($?.[1])||0;F.mc=$?.[2];F.isMember=$?.[3];F.errors=$?.[4];F.raw=$?.[5];F.fetchError=$?.[6];return[buildListAddMemberRow({addResult:F,memberCountBefore:D,listId:H,username:P,userId:J})]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as e,Strategy as t}from"@jackwener/opencli/registry";import{buildListAddMemberRow,listAddUser}from"./list-add-core.js";e({site:"twitter",name:"list-add",access:"write",description:"Add a user to a Twitter/X list you own (no-op if already a member)",domain:"x.com",strategy:t.UI,browser:!0,args:[{name:"listId",positional:!0,type:"string",required:!0,help:"Numeric ID of the list you own (e.g. from `opencli twitter lists`)"},{name:"username",positional:!0,type:"string",required:!0,help:"Twitter/X handle to add (with or without @)"}],columns:["listId","username","userId","status","message"],func:listAddUser});export{buildListAddMemberRow,listAddUser};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ArgumentError as a,AuthRequiredError as l}from"@jackwener/opencli/errors";const m=/^[A-Za-z0-9_]{1,15}$/,h=5,f=600;export function parseCommaSeparatedUsernames(t,e){const n=String(t||"").trim();if(!n)throw new a("At least one username is required",e);const u=n.split(",").map((r)=>r.trim().replace(/^@/,"")).filter(Boolean);if(u.length===0)throw new a("At least one username is required",e);const c=new Set,i=[];for(const r of u){if(!m.test(r))throw new a(`Invalid Twitter/X username: ${JSON.stringify(r)}`,e);const o=r.toLowerCase();if(c.has(o))continue;c.add(o);i.push(r)}return i}export function parseBatchIntervalSeconds(t){const e=t===void 0||t===null||t===""?h:Number(t);if(!Number.isInteger(e)||e<0||e>f)throw new a(`Invalid interval: ${JSON.stringify(t)}. Expected an integer from 0 to ${f}.`);return e}export function toBatchFailureRow({listId:t,username:e,error:n}){return{listId:t,username:e,userId:"",status:"failed",message:n?.message||String(n)}}function w(t){if(t instanceof a||t instanceof l)return!0;const e=t?.message||String(t);return/Invalid listId|Could not fetch lists|List \d+ not found among your lists|Not logged into x\.com/i.test(e)}export async function waitBetweenBatchItems(t,e){if(e<=0)return;if(t&&typeof t.wait==="function"){await t.wait(e);return}await new Promise((n)=>setTimeout(n,e*1000))}export async function runListBatch({page:t,listId:e,usernames:n,interval:u,operation:c}){const i=[];for(let r=0;r<n.length;r++){const o=n[r];try{const s=await c(t,{listId:e,username:o});i.push(...s)}catch(s){if(w(s))throw s;i.push(toBatchFailureRow({listId:e,username:o,error:s}))}if(r<n.length-1)await waitBetweenBatchItems(t,u)}return i}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{cli as D,Strategy as O}from"@jackwener/opencli/registry";import{ArgumentError as Q,AuthRequiredError as B,CommandExecutionError as Z}from"@jackwener/opencli/errors";import{unwrapBrowserResult as P}from"./shared.js";import{TWITTER_BEARER_TOKEN as q}from"./utils.js";const y="UQRa0jJ9doxGEIQRea1Y0w",W=25,Y=100,S={profile_label_improvements_pcf_label_in_post_enabled:!0,responsive_web_profile_redirect_enabled:!1,rweb_tipjar_consumption_enabled:!1,verified_phone_label_enabled:!1,responsive_web_graphql_skip_user_profile_image_extensions_enabled:!1,responsive_web_graphql_timeline_navigation_enabled:!0};export function parseListCreateArgs(z){const H=String(z.name||"").trim(),J=String(z.description||"").trim(),G=String(z.mode||"public").trim().toLowerCase();if(!H)throw new Q("List name is required",'Example: opencli twitter list-create "My List"');if(H.length>W)throw new Q(`List name too long: ${H.length} chars (max ${W})`);if(J.length>Y)throw new Q(`Description too long: ${J.length} chars (max ${Y})`);if(G!=="public"&&G!=="private")throw new Q(`Invalid mode: ${JSON.stringify(z.mode)}. Expected "public" or "private".`);return{listName:H,listDescription:J,listMode:G,privateFlag:G==="private"}}function X(z,H,J){if(!z||typeof z!=="object")throw new Z(`Unexpected result from twitter list-create: ${JSON.stringify(z)}`);if(z.httpStatus===401||z.httpStatus===403)throw new B("x.com",`Twitter CreateList returned HTTP ${z.httpStatus}`);if(!z.ok){const $=String(z.bodyText||"").slice(0,300);throw new Z(`HTTP ${z.httpStatus} from CreateList: ${$}`)}if(!z.bodyJson||typeof z.bodyJson!=="object")throw new Z(`CreateList returned malformed JSON payload. Body: ${String(z.bodyText||"").slice(0,300)}`);const G=z.bodyJson?.data?.list;if(!G||typeof G!=="object"){const $=z.bodyJson?.errors;if(Array.isArray($)&&$.length>0)throw new Z(`CreateList failed: ${$[0].message||JSON.stringify($[0])}`);throw new Z(`CreateList returned no list payload. Body: ${String(z.bodyText||"").slice(0,300)}`)}const v=String(G.id_str||G.id||"");if(!/^\d+$/.test(v))throw new Z("CreateList returned a list payload without a numeric list id.");if(typeof G.name!=="string"||!G.name.trim())throw new Z("CreateList returned a list payload without a list name.");if(G.name.trim()!==H)throw new Z(`CreateList returned name ${JSON.stringify(G.name)}, expected ${JSON.stringify(H)}.`);const F=typeof G.mode==="string"?G.mode:"";if(!F)throw new Z("CreateList returned a list payload without list mode.");const K=/private/i.test(F)?"private":"public";if(K!==J)throw new Z(`CreateList returned mode ${K}, expected ${J}.`);return{createdList:G,listId:v,listMode:K}}export function buildListCreateRow({result:z,name:H,description:J,mode:G}){const{createdList:v,listId:F,listMode:K}=X(z,H,G);return{id:F,name:v.name,description:typeof v.description==="string"?v.description:J,mode:K,status:"success"}}D({site:"twitter",name:"list-create",description:"Create a new Twitter/X list (returns the new list id)",access:"write",domain:"x.com",strategy:O.COOKIE,browser:!0,args:[{name:"name",positional:!0,type:"string",required:!0,help:`List name (max ${W} chars)`},{name:"description",type:"string",default:"",help:`Optional list description (max ${Y} chars)`},{name:"mode",type:"string",default:"public",help:"public | private"}],columns:["id","name","description","mode","status"],func:async(z,H)=>{const{listName:J,listDescription:G,listMode:v,privateFlag:F}=parseListCreateArgs(H);await z.goto("https://x.com");await z.wait(3);const $=(await z.getCookies({url:"https://x.com"})).find((j)=>j.name==="ct0")?.value||null;if(!$)throw new B("x.com","Not logged into x.com (no ct0 cookie)");const f=y,V=JSON.stringify({Authorization:`Bearer ${decodeURIComponent(q)}`,"X-Csrf-Token":$,"X-Twitter-Auth-Type":"OAuth2Session","X-Twitter-Active-User":"yes","Content-Type":"application/json"}),b=JSON.stringify({variables:{isPrivate:F,name:J,description:G},features:S,queryId:f}),U=`/i/api/graphql/${f}/CreateList`,h=P(await z.evaluate(`async () => {
|
|
2
|
+
const r = await fetch(${JSON.stringify(U)}, {
|
|
3
|
+
method: 'POST',
|
|
4
|
+
headers: ${V},
|
|
5
|
+
credentials: 'include',
|
|
6
|
+
body: ${JSON.stringify(b)},
|
|
7
|
+
});
|
|
8
|
+
const bodyText = await r.text();
|
|
9
|
+
let bodyJson = null;
|
|
10
|
+
try { bodyJson = JSON.parse(bodyText); } catch {}
|
|
11
|
+
return { ok: r.ok, httpStatus: r.status, bodyJson, bodyText };
|
|
12
|
+
}`));return[buildListCreateRow({result:h,name:J,description:G,mode:v})]}});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import{cli as f,Strategy as w}from"@jackwener/opencli/registry";import{ArgumentError as d,AuthRequiredError as p,CommandExecutionError as r}from"@jackwener/opencli/errors";import{resolveTwitterQueryId as b,unwrapBrowserResult as c}from"./shared.js";import{parseListsManagement as g}from"./lists.js";import{TWITTER_BEARER_TOKEN as h}from"./utils.js";const y="78UbkyXwXBD98IgUWXOy9g",v={rweb_video_screen_enabled:!1,profile_label_improvements_pcf_label_in_post_enabled:!0,rweb_tipjar_consumption_enabled:!0,verified_phone_label_enabled:!1,creator_subscriptions_tweet_preview_api_enabled:!0,responsive_web_graphql_timeline_navigation_enabled:!0,responsive_web_graphql_skip_user_profile_image_extensions_enabled:!1,premium_content_api_read_enabled:!1,communities_web_enable_tweet_community_results_fetch:!0,c9s_tweet_anatomy_moderator_badge_enabled:!0,responsive_web_grok_analyze_button_fetch_trends_enabled:!1,responsive_web_grok_analyze_post_followups_enabled:!0,responsive_web_jetfuel_frame:!1,responsive_web_grok_share_attachment_enabled:!0,articles_preview_enabled:!0,responsive_web_edit_tweet_api_enabled:!0,graphql_is_translatable_rweb_tweet_is_translatable_enabled:!0,view_counts_everywhere_api_enabled:!0,longform_notetweets_consumption_enabled:!0,responsive_web_twitter_article_tweet_consumption_enabled:!0,tweet_awards_web_tipping_enabled:!1,responsive_web_grok_show_grok_translated_post:!1,responsive_web_grok_analysis_button_from_backend:!1,creator_subscriptions_quote_tweet_preview_enabled:!1,freedom_of_speech_not_reach_fetch_enabled:!0,standardized_nudges_misinfo:!0,tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled:!0,longform_notetweets_rich_text_read_enabled:!0,longform_notetweets_inline_media_enabled:!0,responsive_web_grok_image_annotation_enabled:!0,responsive_web_enhance_cards_enabled:!1};function k(e){return e===!0||e==="true"}async function m(e,t){const s=`/i/api/graphql/${await b(e,"ListsManagementPageTimeline",y)}/ListsManagementPageTimeline?features=${encodeURIComponent(JSON.stringify(v))}`,i=c(await e.evaluate(`async () => {
|
|
2
|
+
const r = await fetch(${JSON.stringify(s)}, { headers: ${t}, credentials: 'include' });
|
|
3
|
+
if (!r.ok) return { __error: 'HTTP ' + r.status };
|
|
4
|
+
return await r.json();
|
|
5
|
+
}`));if(i&&i.__error)throw new r(`Could not fetch lists: ${i.__error}`);return g(i,new Set)}export function buildListDeleteRow({listId:e,targetList:t}){return{listId:e,name:t.name,members:String(t.members??"0"),status:"success",message:`Deleted list ${t.name} (${t.members??"0"} members)`}}f({site:"twitter",name:"list-delete",access:"write",description:"Delete a Twitter/X list you own after explicit confirmation",domain:"x.com",strategy:w.UI,browser:!0,args:[{name:"listId",positional:!0,type:"string",required:!0,help:"Numeric ID of the list you own (e.g. from `opencli twitter lists`)"},{name:"confirm",type:"boolean",default:!1,help:"Required. Set --confirm true to delete the list."},{name:"timeout",type:"int",default:300,help:"Max seconds for the overall delete command (default: 300)"}],columns:["listId","name","members","status","message"],func:async(e,t)=>{const n=String(t.listId||"").trim();if(!n||!/^\d+$/.test(n))throw new d(`Invalid listId: ${JSON.stringify(t.listId)}. Expected numeric ID.`,"Example: opencli twitter list-delete 123456789 --confirm true");if(!k(t.confirm))throw new d("Refusing to delete list without --confirm true","Example: opencli twitter list-delete 123456789 --confirm true");await e.goto("https://x.com");await e.wait(3);const i=(await e.getCookies({url:"https://x.com"})).find((o)=>o.name==="ct0")?.value||null;if(!i)throw new p("x.com","Not logged into x.com (no ct0 cookie)");const a=JSON.stringify({Authorization:`Bearer ${decodeURIComponent(h)}`,"X-Csrf-Token":i,"X-Twitter-Auth-Type":"OAuth2Session","X-Twitter-Active-User":"yes"}),l=await m(e,a),_=l.find((o)=>o.id===n);if(!_)throw new r(`List ${n} not found among your lists (${l.length} lists fetched).`);await e.goto(`https://x.com/i/lists/${n}`);await e.wait({selector:'[data-testid="primaryColumn"]'});const u=c(await e.evaluate(`(async () => {
|
|
6
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
7
|
+
const visible = (el) => !!el && el.offsetParent !== null;
|
|
8
|
+
const buttonText = (el) => (el.innerText || el.textContent || '').trim();
|
|
9
|
+
const waitFor = async (fn, { timeoutMs = 10000, intervalMs = 200 } = {}) => {
|
|
10
|
+
const started = Date.now();
|
|
11
|
+
while (Date.now() - started < timeoutMs) {
|
|
12
|
+
const value = fn();
|
|
13
|
+
if (value) return value;
|
|
14
|
+
await sleep(intervalMs);
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
};
|
|
18
|
+
const findButton = (text) => Array.from(document.querySelectorAll('button, [role="button"]'))
|
|
19
|
+
.find((el) => visible(el) && buttonText(el).toLowerCase() === text.toLowerCase());
|
|
20
|
+
const editLink = Array.from(document.querySelectorAll('a[href$="/info"]'))
|
|
21
|
+
.find((el) => visible(el) && /edit list/i.test(el.innerText || el.textContent || ''));
|
|
22
|
+
if (!editLink) return { ok: false, message: 'Edit List link not found' };
|
|
23
|
+
editLink.click();
|
|
24
|
+
const editDialog = await waitFor(() => document.querySelector('[role="dialog"]'));
|
|
25
|
+
if (!editDialog) return { ok: false, message: 'Edit List dialog did not open' };
|
|
26
|
+
const deleteButton = findButton('Delete List');
|
|
27
|
+
if (!deleteButton) return { ok: false, message: 'Delete List button not found' };
|
|
28
|
+
deleteButton.click();
|
|
29
|
+
await sleep(800);
|
|
30
|
+
const confirmButton = document.querySelector('[data-testid="confirmationSheetConfirm"]')
|
|
31
|
+
|| findButton('Delete');
|
|
32
|
+
if (!confirmButton) return { ok: false, message: 'Delete confirmation button not found' };
|
|
33
|
+
confirmButton.click();
|
|
34
|
+
await sleep(2500);
|
|
35
|
+
return { ok: true, url: location.href };
|
|
36
|
+
})()`));if(!u?.ok)throw new r(`Failed to delete list ${n}: ${u?.message||"unknown UI failure"}`);if((await m(e,a)).some((o)=>o.id===n))throw new r(`Failed to delete list ${n}: list still appears in managed lists.`);return[buildListDeleteRow({listId:n,targetList:_})]}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as o,Strategy as i}from"@jackwener/opencli/registry";import{listRemoveUser as n}from"./list-remove-core.js";import{parseBatchIntervalSeconds as m,parseCommaSeparatedUsernames as l,runListBatch as u}from"./list-batch-utils.js";const c='Example: opencli twitter list-remove-batch 123456789 "@alice,@bob" --interval 5';o({site:"twitter",name:"list-remove-batch",access:"write",description:"Remove multiple users from a Twitter/X list you own from a comma-separated username list",domain:"x.com",strategy:i.UI,browser:!0,args:[{name:"listId",positional:!0,type:"string",required:!0,help:"Numeric ID of the list you own (e.g. from `opencli twitter lists`)"},{name:"usernames",positional:!0,type:"string",required:!0,help:"Comma-separated Twitter/X handles to remove (with or without @)"},{name:"interval",type:"int",default:5,help:"Seconds to wait between account removals (default: 5)"},{name:"timeout",type:"int",default:600,help:"Max seconds for the overall batch command (default: 600)"}],columns:["listId","username","userId","status","message"],func:async(t,e)=>{const r=String(e.listId||"").trim(),a=l(e.usernames,c),s=m(e.interval);return u({page:t,listId:r,usernames:a,interval:s,operation:n})}});
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import{ArgumentError as h,AuthRequiredError as x,CommandExecutionError as X}from"@jackwener/opencli/errors";import{resolveTwitterQueryId as k,unwrapBrowserResult as O}from"./shared.js";import{getListsManagementInstructions as L,parseListsManagement as M}from"./lists.js";import{TWITTER_BEARER_TOKEN as T}from"./utils.js";const N="IGgvgiOx4QZndDHuD3x9TQ",_="78UbkyXwXBD98IgUWXOy9g",B={rweb_video_screen_enabled:!1,profile_label_improvements_pcf_label_in_post_enabled:!0,rweb_tipjar_consumption_enabled:!0,verified_phone_label_enabled:!1,creator_subscriptions_tweet_preview_api_enabled:!0,responsive_web_graphql_timeline_navigation_enabled:!0,responsive_web_graphql_skip_user_profile_image_extensions_enabled:!1,premium_content_api_read_enabled:!1,communities_web_enable_tweet_community_results_fetch:!0,c9s_tweet_anatomy_moderator_badge_enabled:!0,responsive_web_grok_analyze_button_fetch_trends_enabled:!1,responsive_web_grok_analyze_post_followups_enabled:!0,responsive_web_jetfuel_frame:!1,responsive_web_grok_share_attachment_enabled:!0,articles_preview_enabled:!0,responsive_web_edit_tweet_api_enabled:!0,graphql_is_translatable_rweb_tweet_is_translatable_enabled:!0,view_counts_everywhere_api_enabled:!0,longform_notetweets_consumption_enabled:!0,responsive_web_twitter_article_tweet_consumption_enabled:!0,tweet_awards_web_tipping_enabled:!1,responsive_web_grok_show_grok_translated_post:!1,responsive_web_grok_analysis_button_from_backend:!1,creator_subscriptions_quote_tweet_preview_enabled:!1,freedom_of_speech_not_reach_fetch_enabled:!0,standardized_nudges_misinfo:!0,tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled:!0,longform_notetweets_rich_text_read_enabled:!0,longform_notetweets_inline_media_enabled:!0,responsive_web_grok_image_annotation_enabled:!0,responsive_web_enhance_cards_enabled:!1};function f(z,J){const H=JSON.stringify({screen_name:J,withSafetyModeUserFields:!0}),P=JSON.stringify({hidden_profile_subscriptions_enabled:!0,rweb_tipjar_consumption_enabled:!0,responsive_web_graphql_exclude_directive_enabled:!0,verified_phone_label_enabled:!1,subscriptions_verification_info_is_identity_verified_enabled:!0,subscriptions_verification_info_verified_since_enabled:!0,highlights_tweets_tab_ui_enabled:!0,responsive_web_twitter_article_notes_tab_enabled:!0,subscriptions_feature_can_gift_premium:!0,creator_subscriptions_tweet_preview_api_enabled:!0,responsive_web_graphql_skip_user_profile_image_extensions_enabled:!1,responsive_web_graphql_timeline_navigation_enabled:!0});return`/i/api/graphql/${z}/UserByScreenName?variables=${encodeURIComponent(H)}&features=${encodeURIComponent(P)}`}export function interpretRemoveResponse(z,J){if(z===200&&J&&(J.id_str||J.id||J.slug))return{ok:!0};if(J&&Array.isArray(J.errors)&&J.errors.length>0){const H=J.errors[0];return{ok:!1,error:`${H.code?"["+H.code+"] ":""}${H.message||"Unknown error"}`}}return{ok:!1,error:`HTTP ${z}`}}export async function listRemoveUser(z,J){const H=String(J.listId||"").trim(),P=String(J.username||"").replace(/^@/,"").trim();if(!H||!/^\d+$/.test(H))throw new h(`Invalid listId: ${JSON.stringify(J.listId)}. Expected numeric ID.`);if(!P)throw new h("twitter list-remove username is required");await z.goto("https://x.com");await z.wait(3);const Y=(await z.getCookies({url:"https://x.com"})).find((Z)=>Z.name==="ct0")?.value||null;if(!Y)throw new x("x.com","Not logged into x.com (no ct0 cookie)");const y=await k(z,"UserByScreenName",N),W=JSON.stringify({Authorization:`Bearer ${decodeURIComponent(T)}`,"X-Csrf-Token":Y,"X-Twitter-Auth-Type":"OAuth2Session","X-Twitter-Active-User":"yes"}),S=f(y,P),Q=O(await z.evaluate(`async () => {
|
|
2
|
+
const resp = await fetch(${JSON.stringify(S)}, { headers: ${W}, credentials: 'include' });
|
|
3
|
+
if (!resp.ok) return null;
|
|
4
|
+
const d = await resp.json();
|
|
5
|
+
return d.data?.user?.result?.rest_id || null;
|
|
6
|
+
}`));if(!Q)throw new X(`Could not resolve user @${P}`);const v=`/i/api/graphql/${await k(z,"ListsManagementPageTimeline",_)}/ListsManagementPageTimeline?features=${encodeURIComponent(JSON.stringify(B))}`,K=O(await z.evaluate(`async () => {
|
|
7
|
+
const r = await fetch(${JSON.stringify(v)}, { headers: ${W}, credentials: 'include' });
|
|
8
|
+
if (!r.ok) return { __error: 'HTTP ' + r.status };
|
|
9
|
+
return await r.json();
|
|
10
|
+
}`));if(K&&K.__error)throw new X(`Could not fetch lists: ${K.__error}`);const G=M(K,new Set).find((Z)=>Z.id===H);if(!G)throw new X(`List ${H} not found among your lists.`);const U=G.name;await z.goto(`https://x.com/${P}`);await z.wait({selector:'[data-testid="primaryColumn"]'});const V=O(await z.evaluate(`(async () => {
|
|
11
|
+
const sleep = (ms) => new Promise(r => setTimeout(r, ms));
|
|
12
|
+
const findOne = (sel, root = document) => root.querySelector(sel);
|
|
13
|
+
const waitFor = async (fn, { timeoutMs = 8000, intervalMs = 200 } = {}) => {
|
|
14
|
+
const t0 = Date.now();
|
|
15
|
+
while (Date.now() - t0 < timeoutMs) { const v = fn(); if (v) return v; await sleep(intervalMs); }
|
|
16
|
+
return null;
|
|
17
|
+
};
|
|
18
|
+
try {
|
|
19
|
+
if (!window.__opencliListMutations) {
|
|
20
|
+
window.__opencliListMutations = [];
|
|
21
|
+
const origFetch = window.fetch.bind(window);
|
|
22
|
+
window.fetch = async function(...args) {
|
|
23
|
+
const url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url) || '';
|
|
24
|
+
const method = (args[1] && args[1].method) || 'GET';
|
|
25
|
+
let resp;
|
|
26
|
+
try { resp = await origFetch(...args); } catch (err) {
|
|
27
|
+
if (/ListAddMember|ListRemoveMember|lists\\/members\\/(create|destroy)/.test(url)) {
|
|
28
|
+
window.__opencliListMutations.push({ url, method, status: 0, error: String(err), ts: Date.now() });
|
|
29
|
+
}
|
|
30
|
+
throw err;
|
|
31
|
+
}
|
|
32
|
+
if (/ListAddMember|ListRemoveMember|lists\\/members\\/(create|destroy)/.test(url)) {
|
|
33
|
+
window.__opencliListMutations.push({ url, method, status: resp.status, ts: Date.now() });
|
|
34
|
+
}
|
|
35
|
+
return resp;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
window.__opencliListMutations.length = 0;
|
|
39
|
+
|
|
40
|
+
const caret = await waitFor(() => findOne('[data-testid="userActions"]'));
|
|
41
|
+
if (!caret) return { ok: false, message: 'Could not find user actions (…) button' };
|
|
42
|
+
caret.click();
|
|
43
|
+
await sleep(600);
|
|
44
|
+
const menuItems = Array.from(document.querySelectorAll('[role="menuitem"]'));
|
|
45
|
+
const addToListItem = menuItems.find(el => /add\\/remove|从列表|列表|add to list|add or remove/i.test(el.innerText));
|
|
46
|
+
if (!addToListItem) return { ok: false, message: 'Could not find "Add/remove from Lists" menu item' };
|
|
47
|
+
addToListItem.click();
|
|
48
|
+
await sleep(1200);
|
|
49
|
+
const dialog = await waitFor(() => findOne('[role="dialog"]'));
|
|
50
|
+
if (!dialog) return { ok: false, message: 'List selection dialog did not open' };
|
|
51
|
+
|
|
52
|
+
const targetName = ${JSON.stringify(U)};
|
|
53
|
+
const scrollCandidates = [
|
|
54
|
+
dialog.querySelector('[data-viewportview="true"]'),
|
|
55
|
+
...Array.from(dialog.querySelectorAll('div')).filter(d => d.scrollHeight > d.clientHeight + 10),
|
|
56
|
+
].filter(Boolean);
|
|
57
|
+
let scrollEl = scrollCandidates[0] || dialog;
|
|
58
|
+
for (const se of scrollCandidates) {
|
|
59
|
+
if (se.scrollHeight > se.clientHeight + 10) { scrollEl = se; break; }
|
|
60
|
+
}
|
|
61
|
+
let row = null;
|
|
62
|
+
let lastScrollTop = -1;
|
|
63
|
+
for (let i = 0; i < 12; i++) {
|
|
64
|
+
const cells = Array.from(dialog.querySelectorAll('[data-testid="cellInnerDiv"]'));
|
|
65
|
+
row = cells.find(c => (c.innerText || '').split('\\n')[0].trim() === targetName);
|
|
66
|
+
if (row) break;
|
|
67
|
+
const prev = scrollEl.scrollTop;
|
|
68
|
+
scrollEl.scrollTop = prev + Math.max(200, scrollEl.clientHeight - 100);
|
|
69
|
+
if (scrollEl.scrollTop === prev && scrollEl.scrollTop === lastScrollTop) break;
|
|
70
|
+
lastScrollTop = scrollEl.scrollTop;
|
|
71
|
+
await sleep(500);
|
|
72
|
+
}
|
|
73
|
+
if (!row) {
|
|
74
|
+
const names = Array.from(dialog.querySelectorAll('[data-testid="cellInnerDiv"]'))
|
|
75
|
+
.map(c => (c.innerText || '').split('\\n')[0].trim()).filter(Boolean);
|
|
76
|
+
return { ok: false, message: 'List "' + targetName + '" not found in dialog. Saw: ' + names.join(' | ') };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Determine current membership: row has a filled checkmark (svg inside a specific container) when member.
|
|
80
|
+
// Heuristic: look for an aria-checked attribute, or an svg with specific fill on the row's right side.
|
|
81
|
+
// The listCell itself carries aria-checked. Require a stable reading
|
|
82
|
+
// (same value twice ~500ms apart) to avoid the X dialog's occasional
|
|
83
|
+
// flash of stale state when re-opened shortly after a toggle.
|
|
84
|
+
const listCell = row.querySelector('[data-testid="listCell"]') || row.querySelector('[role="checkbox"]') || row;
|
|
85
|
+
const readChecked = () => {
|
|
86
|
+
const v = listCell.getAttribute('aria-checked');
|
|
87
|
+
return v === 'true' || v === 'false' ? v : null;
|
|
88
|
+
};
|
|
89
|
+
await sleep(600);
|
|
90
|
+
let ariaChecked = readChecked();
|
|
91
|
+
for (let i = 0; i < 8; i++) {
|
|
92
|
+
await sleep(500);
|
|
93
|
+
const next = readChecked();
|
|
94
|
+
if (next && next === ariaChecked) break;
|
|
95
|
+
ariaChecked = next || ariaChecked;
|
|
96
|
+
}
|
|
97
|
+
const isMember = ariaChecked === 'true';
|
|
98
|
+
if (!isMember) {
|
|
99
|
+
const closeBtn = findOne('[data-testid="app-bar-close"]') || findOne('[aria-label="Close"]');
|
|
100
|
+
if (closeBtn) closeBtn.click();
|
|
101
|
+
return { ok: true, noop: true };
|
|
102
|
+
}
|
|
103
|
+
try { listCell.scrollIntoView({ block: 'center' }); } catch {}
|
|
104
|
+
await sleep(400);
|
|
105
|
+
const rowRect = listCell.getBoundingClientRect();
|
|
106
|
+
const saveButton = Array.from(dialog.querySelectorAll('[role="button"], button')).find(b => {
|
|
107
|
+
const txt = (b.innerText || '').trim();
|
|
108
|
+
return /^(Save|Done|保存|完成|儲存)$/i.test(txt);
|
|
109
|
+
});
|
|
110
|
+
const saveRect = saveButton ? saveButton.getBoundingClientRect() : null;
|
|
111
|
+
return {
|
|
112
|
+
ok: true,
|
|
113
|
+
needsNativeInteraction: true,
|
|
114
|
+
rowClickX: Math.round(rowRect.left + rowRect.width / 2),
|
|
115
|
+
rowClickY: Math.round(rowRect.top + rowRect.height / 2),
|
|
116
|
+
saveClickX: saveRect ? Math.round(saveRect.left + saveRect.width / 2) : null,
|
|
117
|
+
saveClickY: saveRect ? Math.round(saveRect.top + saveRect.height / 2) : null,
|
|
118
|
+
mutationsBefore: window.__opencliListMutations.length,
|
|
119
|
+
};
|
|
120
|
+
} catch (e) {
|
|
121
|
+
return { ok: false, message: 'UI error: ' + (e?.message || String(e)) };
|
|
122
|
+
}
|
|
123
|
+
})()`));if(!V.ok)throw new X(`Failed to remove @${P} from list ${H}: ${V.message}`);let D=null;if(V.needsNativeInteraction){if(typeof z.nativeClick!=="function")throw new X("Requires up-to-date Chrome extension (nativeClick).");if(!V.saveClickX)throw new X("Save button not found in dialog.");const Z=Number(G.members)||0;await z.nativeClick(V.rowClickX,V.rowClickY);await new Promise((F)=>setTimeout(F,800));await z.nativeClick(V.saveClickX,V.saveClickY);await new Promise((F)=>setTimeout(F,3500));const $=O(await z.evaluate(`async () => {
|
|
124
|
+
const r = await fetch(${JSON.stringify(v)}, { headers: ${W}, credentials: 'include' });
|
|
125
|
+
if (!r.ok) return { __error: 'HTTP ' + r.status };
|
|
126
|
+
return await r.json();
|
|
127
|
+
}`));if($&&$.__error)throw new X(`Could not verify list removal: ${$.__error}`);if(!L($))throw new X("Could not verify list removal: unexpected lists payload shape");const b=M($,new Set).find((F)=>F.id===H);if(!b)throw new X(`Could not verify list removal: list ${H} missing from post-delete payload`);const q=Number(b.members)||0;if(q<Z)D=`member_count ${Z} → ${q}`;else throw new X(`Failed to remove @${P} from list ${H}: member_count unchanged (${Z} → ${q}).`)}return[{listId:H,username:P,userId:String(Q),status:V.noop?"noop":"success",message:V.noop?`@${P} was not a member of list ${H}`:`Removed @${P} from list ${H} (verified via ${D})`}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cli as e,Strategy as t}from"@jackwener/opencli/registry";import{interpretRemoveResponse,listRemoveUser}from"./list-remove-core.js";e({site:"twitter",name:"list-remove",access:"write",description:"Remove a user from a Twitter/X list you own (toggles via UI; no-op if not currently a member)",domain:"x.com",strategy:t.UI,browser:!0,args:[{name:"listId",positional:!0,type:"string",required:!0,help:"Numeric ID of the list you own (e.g. from `opencli twitter lists`)"},{name:"username",positional:!0,type:"string",required:!0,help:"Twitter/X handle to remove (with or without @)"}],columns:["listId","username","userId","status","message"],func:listRemoveUser});export{interpretRemoveResponse,listRemoveUser};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{cli as U,Strategy as h}from"@jackwener/opencli/registry";import{AuthRequiredError as S,CommandExecutionError as j}from"@jackwener/opencli/errors";import{BROWSER_JSON_SNIFF_FN as O,throwIfLoginWall as k}from"@jackwener/opencli/utils";import{TWITTER_BEARER_TOKEN as C,applyTopByEngagement as R}from"./utils.js";import{extractCard as _,extractQuotedTweet as v,extractMedia as A,describeTwitterApiError as N}from"./shared.js";const x="RlZzktZY_9wJynoepm8ZsA",L="ListLatestTweetsTimeline",m=100,p={rweb_video_screen_enabled:!1,profile_label_improvements_pcf_label_in_post_enabled:!0,rweb_tipjar_consumption_enabled:!0,verified_phone_label_enabled:!1,creator_subscriptions_tweet_preview_api_enabled:!0,responsive_web_graphql_timeline_navigation_enabled:!0,responsive_web_graphql_skip_user_profile_image_extensions_enabled:!1,premium_content_api_read_enabled:!1,communities_web_enable_tweet_community_results_fetch:!0,c9s_tweet_anatomy_moderator_badge_enabled:!0,responsive_web_grok_analyze_button_fetch_trends_enabled:!1,responsive_web_grok_analyze_post_followups_enabled:!0,responsive_web_jetfuel_frame:!1,responsive_web_grok_share_attachment_enabled:!0,articles_preview_enabled:!0,responsive_web_edit_tweet_api_enabled:!0,graphql_is_translatable_rweb_tweet_is_translatable_enabled:!0,view_counts_everywhere_api_enabled:!0,longform_notetweets_consumption_enabled:!0,responsive_web_twitter_article_tweet_consumption_enabled:!0,tweet_awards_web_tipping_enabled:!1,responsive_web_grok_show_grok_translated_post:!1,responsive_web_grok_analysis_button_from_backend:!1,creator_subscriptions_quote_tweet_preview_enabled:!1,freedom_of_speech_not_reach_fetch_enabled:!0,standardized_nudges_misinfo:!0,tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled:!0,longform_notetweets_rich_text_read_enabled:!0,longform_notetweets_inline_media_enabled:!0,responsive_web_grok_image_annotation_enabled:!0,responsive_web_enhance_cards_enabled:!1};function I($,Z,z,H){const D={listId:String(Z),count:z};if(H)D.cursor=H;return`/i/api/graphql/${$}/${L}?variables=${encodeURIComponent(JSON.stringify(D))}&features=${encodeURIComponent(JSON.stringify(p))}`}export function extractTimelineTweet($,Z){if(!$)return null;const z=$.tweet||$,H=z.legacy||{};if(!z.rest_id||Z.has(z.rest_id))return null;Z.add(z.rest_id);const D=z.core?.user_results?.result,X=D?.legacy?.screen_name||D?.core?.screen_name||"unknown",Y=D?.legacy?.name||D?.core?.name||"",V=D?.legacy?.description||"",f=z.note_tweet?.note_tweet_results?.result?.text;return{id:z.rest_id,author:X,name:Y,bio:V,text:f||H.full_text||"",likes:H.favorite_count||0,retweets:H.retweet_count||0,replies:H.reply_count||0,created_at:H.created_at||"",url:`https://x.com/${X}/status/${z.rest_id}`,...A(H),card:_(z),quoted_tweet:v(z)}}export function parseListTimeline($,Z){const z=[];let H=null;const D=$?.data?.list?.tweets_timeline?.timeline?.instructions||[];for(const X of D)for(const Y of X.entries||[]){const V=Y.content;if(V?.entryType==="TimelineTimelineCursor"||V?.__typename==="TimelineTimelineCursor"){if(V.cursorType==="Bottom"||V.cursorType==="ShowMore")H=V.value;continue}if(Y.entryId?.startsWith("cursor-bottom-")||Y.entryId?.startsWith("cursor-showMore-")){H=V?.value||V?.itemContent?.value||H;continue}const f=extractTimelineTweet(V?.itemContent?.tweet_results?.result,Z);if(f){z.push(f);continue}for(const G of V?.items||[]){const K=extractTimelineTweet(G.item?.itemContent?.tweet_results?.result,Z);if(K)z.push(K)}}return{tweets:z,nextCursor:H}}U({site:"twitter",name:"list-tweets",access:"read",description:"Fetch tweets from a Twitter/X list timeline",domain:"x.com",strategy:h.COOKIE,browser:!0,args:[{name:"listId",positional:!0,type:"string",required:!0,help:"Numeric ID of a Twitter/X list (e.g. from `opencli twitter lists`)"},{name:"limit",type:"int",default:50},{name:"top-by-engagement",type:"int",default:0,help:"When set to N>0, re-rank the list timeline by weighted engagement (likes×1 + retweets×3 + replies×2 + bookmarks×5 + log10(views+1)×0.5) and return the top N. Default 0 keeps the list's native (recency) ordering."}],columns:["id","author","bio","text","likes","retweets","replies","created_at","url","has_media","media_urls","media_posters","card","quoted_tweet"],func:async($,Z)=>{const z=String(Z.listId||"").trim();if(!z||!/^\d+$/.test(z))throw new j(`Invalid listId: ${JSON.stringify(Z.listId)}. Expected a numeric ID (see \`opencli twitter lists\`).`);const H=Z.limit||50,X=(await $.getCookies({url:"https://x.com"})).find((J)=>J.name==="ct0")?.value||null;if(!X)throw new S("x.com","Not logged into x.com (no ct0 cookie)");const Y=(J)=>J&&typeof J==="object"&&("session"in J)&&("data"in J)?J.data:J,V=await $.evaluate(`async () => {
|
|
2
|
+
try {
|
|
3
|
+
const ghResp = await fetch('https://raw.githubusercontent.com/fa0311/twitter-openapi/refs/heads/main/src/config/placeholder.json');
|
|
4
|
+
if (ghResp.ok) {
|
|
5
|
+
const data = await ghResp.json();
|
|
6
|
+
const entry = data['${L}'];
|
|
7
|
+
if (entry && entry.queryId) return entry.queryId;
|
|
8
|
+
}
|
|
9
|
+
} catch {}
|
|
10
|
+
try {
|
|
11
|
+
const scripts = performance.getEntriesByType('resource')
|
|
12
|
+
.filter(r => r.name.includes('client-web') && r.name.endsWith('.js'))
|
|
13
|
+
.map(r => r.name);
|
|
14
|
+
for (const scriptUrl of scripts.slice(0, 15)) {
|
|
15
|
+
try {
|
|
16
|
+
const text = await (await fetch(scriptUrl)).text();
|
|
17
|
+
const re = /queryId:"([A-Za-z0-9_-]+)"[^}]{0,200}operationName:"${L}"/;
|
|
18
|
+
const m = text.match(re);
|
|
19
|
+
if (m) return m[1];
|
|
20
|
+
} catch {}
|
|
21
|
+
}
|
|
22
|
+
} catch {}
|
|
23
|
+
return null;
|
|
24
|
+
}`),f=Y(V)||x,G=JSON.stringify({Authorization:`Bearer ${decodeURIComponent(C)}`,"X-Csrf-Token":X,"X-Twitter-Auth-Type":"OAuth2Session","X-Twitter-Active-User":"yes"}),K=[],q=new Set;let Q=null;for(let J=0;J<m&&K.length<H;J++){const P=Math.min(100,H-K.length+10),F=I(f,z,P,Q),b=k(await $.evaluate(`async () => {
|
|
25
|
+
${O}
|
|
26
|
+
return await fetchJsonOrLoginWall(${JSON.stringify(F)}, { headers: ${G}, credentials: 'include' });
|
|
27
|
+
}`),{url:F});if(b?.error){if(K.length===0)throw new j(N("ListLatestTweetsTimeline",b.error,"list may be private"));break}const{tweets:W,nextCursor:B}=parseListTimeline(b,q);K.push(...W);if(!B||B===Q||W.length===0)break;Q=B}const M=K.slice(0,H);return R(M,Z["top-by-engagement"])}});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{cli as C,Strategy as D}from"@jackwener/opencli/registry";import{AuthRequiredError as b,CommandExecutionError as Y,EmptyResultError as j}from"@jackwener/opencli/errors";import{TWITTER_BEARER_TOKEN as k}from"./utils.js";import{describeTwitterApiError as P}from"./shared.js";const q="78UbkyXwXBD98IgUWXOy9g",F="ListsManagementPageTimeline",x={rweb_video_screen_enabled:!1,profile_label_improvements_pcf_label_in_post_enabled:!0,rweb_tipjar_consumption_enabled:!0,verified_phone_label_enabled:!1,creator_subscriptions_tweet_preview_api_enabled:!0,responsive_web_graphql_timeline_navigation_enabled:!0,responsive_web_graphql_skip_user_profile_image_extensions_enabled:!1,premium_content_api_read_enabled:!1,communities_web_enable_tweet_community_results_fetch:!0,c9s_tweet_anatomy_moderator_badge_enabled:!0,responsive_web_grok_analyze_button_fetch_trends_enabled:!1,responsive_web_grok_analyze_post_followups_enabled:!0,responsive_web_jetfuel_frame:!1,responsive_web_grok_share_attachment_enabled:!0,articles_preview_enabled:!0,responsive_web_edit_tweet_api_enabled:!0,graphql_is_translatable_rweb_tweet_is_translatable_enabled:!0,view_counts_everywhere_api_enabled:!0,longform_notetweets_consumption_enabled:!0,responsive_web_twitter_article_tweet_consumption_enabled:!0,tweet_awards_web_tipping_enabled:!1,responsive_web_grok_show_grok_translated_post:!1,responsive_web_grok_analysis_button_from_backend:!1,creator_subscriptions_quote_tweet_preview_enabled:!1,freedom_of_speech_not_reach_fetch_enabled:!0,standardized_nudges_misinfo:!0,tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled:!0,longform_notetweets_rich_text_read_enabled:!0,longform_notetweets_inline_media_enabled:!0,responsive_web_grok_image_annotation_enabled:!0,responsive_web_enhance_cards_enabled:!1};function U(f){return`/i/api/graphql/${f}/${F}?features=${encodeURIComponent(JSON.stringify(x))}`}export function extractListEntry(f,G){const z=f?.content?.itemContent?.list||f?.content?.list||f?.item?.itemContent?.list;if(!z)return null;const J=z.id_str||z.id||"";if(!J||G.has(J))return null;G.add(J);const V=typeof z.mode==="string"&&/private/i.test(z.mode)?"private":"public";return{id:String(J),name:z.name||"",members:String(z.member_count??0),followers:String(z.subscriber_count??0),mode:V}}const L="owned-subscribed-list-module-";export function isOwnedSubscribedEntry(f){return typeof f?.entryId==="string"&&f.entryId.startsWith(L)}export function getListsManagementInstructions(f){const G=f?.data?.viewer?.list_management_timeline?.timeline?.instructions||f?.data?.viewer_v2?.user_results?.result?.list_management_timeline?.timeline?.instructions||f?.data?.list_management_timeline?.timeline?.instructions||f?.data?.data?.viewer?.list_management_timeline?.timeline?.instructions||f?.data?.data?.viewer_v2?.user_results?.result?.list_management_timeline?.timeline?.instructions||f?.data?.data?.list_management_timeline?.timeline?.instructions;return Array.isArray(G)?G:null}export function parseListsManagement(f,G){const z=[],J=getListsManagementInstructions(f)||[];for(const V of J)for(const Z of V.entries||[]){if(!isOwnedSubscribedEntry(Z))continue;const $=extractListEntry(Z,G);if($){z.push($);continue}for(const X of Z?.content?.items||[]){const K=extractListEntry(X,G);if(K)z.push(K)}}return z}export const command=C({site:"twitter",name:"lists",access:"read",description:"Get Twitter/X lists for the logged-in user (owned + subscribed)",domain:"x.com",strategy:D.COOKIE,browser:!0,args:[{name:"limit",type:"int",default:50,help:"Maximum number of lists to return (default 50)."}],columns:["id","name","members","followers","mode"],func:async(f,G)=>{const z=G.limit||50,V=(await f.getCookies({url:"https://x.com"})).find((H)=>H.name==="ct0")?.value||null;if(!V)throw new b("x.com","Not logged into x.com (no ct0 cookie)");const Z=(H)=>H&&typeof H==="object"&&("session"in H)&&("data"in H)?H.data:H,$=await f.evaluate(`async () => {
|
|
2
|
+
try {
|
|
3
|
+
const ghResp = await fetch('https://raw.githubusercontent.com/fa0311/twitter-openapi/refs/heads/main/src/config/placeholder.json');
|
|
4
|
+
if (ghResp.ok) {
|
|
5
|
+
const data = await ghResp.json();
|
|
6
|
+
const entry = data['${F}'];
|
|
7
|
+
if (entry && entry.queryId) return entry.queryId;
|
|
8
|
+
}
|
|
9
|
+
} catch {}
|
|
10
|
+
try {
|
|
11
|
+
const scripts = performance.getEntriesByType('resource')
|
|
12
|
+
.filter(r => r.name.includes('client-web') && r.name.endsWith('.js'))
|
|
13
|
+
.map(r => r.name);
|
|
14
|
+
for (const scriptUrl of scripts.slice(0, 15)) {
|
|
15
|
+
try {
|
|
16
|
+
const text = await (await fetch(scriptUrl)).text();
|
|
17
|
+
const re = /queryId:"([A-Za-z0-9_-]+)"[^}]{0,200}operationName:"${F}"/;
|
|
18
|
+
const m = text.match(re);
|
|
19
|
+
if (m) return m[1];
|
|
20
|
+
} catch {}
|
|
21
|
+
}
|
|
22
|
+
} catch {}
|
|
23
|
+
return null;
|
|
24
|
+
}`),X=Z($)||q,K=JSON.stringify({Authorization:`Bearer ${decodeURIComponent(k)}`,"X-Csrf-Token":V,"X-Twitter-Auth-Type":"OAuth2Session","X-Twitter-Active-User":"yes"}),h=U(X),Q=await f.evaluate(`async () => {
|
|
25
|
+
const r = await fetch(${JSON.stringify(h)}, { headers: ${K}, credentials: 'include' });
|
|
26
|
+
return r.ok ? await r.json() : { error: r.status };
|
|
27
|
+
}`);if(Q?.error)throw new Y(P("ListsManagementPageTimeline",Q.error));const B=new Set;if(!getListsManagementInstructions(Q))throw new Y("Twitter lists returned an unexpected payload shape");const W=parseListsManagement(Q,B);if(W.length===0)throw new j("twitter lists","No owned or subscribed lists found");return W.slice(0,z)}});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{CommandExecutionError as _}from"@jackwener/opencli/errors";import{cli as $,Strategy as v}from"@jackwener/opencli/registry";$({site:"twitter",name:"notifications",access:"read",description:"Get your Twitter/X notifications (the logged-in user's likes/replies/follows feed, newest first)",domain:"x.com",strategy:v.INTERCEPT,browser:!0,args:[{name:"limit",type:"int",default:20,help:"Maximum number of notifications to return (default 20)."}],columns:["id","action","author","text","url"],func:async(D,Z)=>{await D.goto("https://x.com/home");await D.wait(3);await D.installInterceptor("NotificationsTimeline");await D.evaluate(`() => {
|
|
2
|
+
window.history.pushState({}, '', '/notifications');
|
|
3
|
+
window.dispatchEvent(new PopStateEvent('popstate', { state: {} }));
|
|
4
|
+
}`);await D.waitForCapture(5);if(await D.evaluate("() => window.location.pathname")!=="/notifications")throw new _("SPA navigation to notifications failed. Twitter may have changed its routing.");await D.autoScroll({times:2,delayMs:2000});const Q=await D.getInterceptedRequests();if(!Q||Q.length===0)return[];let W=[];const X=new Set;for(const G of Q)try{let Y=function(A,M){if(!A)return;let z=A?.notification_results?.result||A?.tweet_results?.result||A,O="Notification",P="",J="",K="";if(z.__typename==="TimelineNotification"){J=z.rich_message?.text||z.message?.text||"";const B=z.template?.from_users?.[0]?.user_results?.result;P=B?.core?.screen_name||B?.legacy?.screen_name||"";K=z.notification_url?.url||"";O=z.notification_icon||"Activity";const F=z.template?.target_objects?.[0]?.tweet_results?.result;if(F){const V=F.note_tweet?.note_tweet_results?.result?.text||F.legacy?.full_text||"";J+=J&&V?" | "+V:V;if(!K)K=`https://x.com/i/status/${F.rest_id}`}}else if(z.__typename==="TweetNotification"){const B=z.tweet_result?.result,F=B?.core?.user_results?.result;P=F?.core?.screen_name||F?.legacy?.screen_name||"";J=B?.note_tweet?.note_tweet_results?.result?.text||B?.legacy?.full_text||z.message?.text||"";O="Mention/Reply";K=`https://x.com/i/status/${B?.rest_id}`}else if(z.__typename==="Tweet"){const B=z.core?.user_results?.result;P=B?.core?.screen_name||B?.legacy?.screen_name||"";J=z.note_tweet?.note_tweet_results?.result?.text||z.legacy?.full_text||"";O="Mention";K=`https://x.com/i/status/${z.rest_id}`}const R=z.id||z.rest_id||M;if(X.has(R))return;X.add(R);W.push({id:R,action:O,author:P,text:J,url:K||"https://x.com/notifications"})},H=[];if(G.data?.viewer?.timeline_response?.timeline?.instructions)H=G.data.viewer.timeline_response.timeline.instructions;else if(G.data?.viewer_v2?.user_results?.result?.notification_timeline?.timeline?.instructions)H=G.data.viewer_v2.user_results.result.notification_timeline.timeline.instructions;else if(G.data?.timeline?.instructions)H=G.data.timeline.instructions;let L=H.find((A)=>A.type==="TimelineAddEntries");if(!L)L=H.find((A)=>A.entries&&Array.isArray(A.entries));if(!L)continue;for(const A of L.entries){if(!A.entryId.startsWith("notification-")){if(A.content?.items)for(const M of A.content.items)Y(M.item?.itemContent,M.entryId);continue}Y(A.content?.itemContent,A.entryId)}}catch(H){}return W.slice(0,Z.limit)}});
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import*as B from"node:fs";import*as X from"node:path";import{cli as C,Strategy as U}from"@jackwener/opencli/registry";import{AuthRequiredError as D,CommandExecutionError as W}from"@jackwener/opencli/errors";import{describeTwitterApiError as L,resolveTwitterOperationMetadata as I,unwrapBrowserResult as b}from"./shared.js";import{isRecoverableFileInputError as m,TWITTER_BEARER_TOKEN as M}from"./utils.js";import{assertLiteralContent as S}from"../_shared/content-guard.js";const k=4,N=500,F=30000,f=250,c=1e4,j=500,y=15000,O="https://x.com/compose/post",x="https://x.com/home",J='input[type="file"][data-testid="fileInput"]',h=new Set([".jpg",".jpeg",".png",".gif",".webp"]),_={queryId:"5CdvsV_zjv4L64XFifAglw",features:{premium_content_api_read_enabled:!1,communities_web_enable_tweet_community_results_fetch:!0,c9s_tweet_anatomy_moderator_badge_enabled:!0,responsive_web_grok_analyze_button_fetch_trends_enabled:!1,responsive_web_grok_analyze_post_followups_enabled:!0,rweb_cashtags_composer_attachment_enabled:!0,responsive_web_jetfuel_frame:!0,responsive_web_grok_share_attachment_enabled:!0,responsive_web_grok_annotations_enabled:!0,responsive_web_edit_tweet_api_enabled:!0,rweb_conversational_replies_downvote_enabled:!1,graphql_is_translatable_rweb_tweet_is_translatable_enabled:!0,view_counts_everywhere_api_enabled:!0,longform_notetweets_consumption_enabled:!0,responsive_web_twitter_article_tweet_consumption_enabled:!0,content_disclosure_indicator_enabled:!0,content_disclosure_ai_generated_indicator_enabled:!0,responsive_web_grok_show_grok_translated_post:!0,responsive_web_grok_analysis_button_from_backend:!0,post_ctas_fetch_enabled:!0,longform_notetweets_rich_text_read_enabled:!0,longform_notetweets_inline_media_enabled:!1,profile_label_improvements_pcf_label_in_post_enabled:!0,responsive_web_profile_redirect_enabled:!1,rweb_tipjar_consumption_enabled:!1,verified_phone_label_enabled:!1,articles_preview_enabled:!0,rweb_cashtags_enabled:!0,responsive_web_grok_community_note_auto_translation_is_enabled:!0,responsive_web_graphql_skip_user_profile_image_extensions_enabled:!1,freedom_of_speech_not_reach_fetch_enabled:!0,standardized_nudges_misinfo:!0,tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled:!0,responsive_web_grok_image_annotation_enabled:!0,responsive_web_grok_imagine_annotation_enabled:!0,responsive_web_graphql_timeline_navigation_enabled:!0},fieldToggles:{}};function d(z){const Q=z.split(",").map((H)=>H.trim()).filter(Boolean);if(Q.length>k)throw new W(`Too many images: ${Q.length} (max ${k})`);return Q.map((H)=>{const Y=X.resolve(H),$=X.extname(Y).toLowerCase();if(!h.has($))throw new W(`Unsupported image format "${$}". Supported: jpg, png, gif, webp`);const Z=B.statSync(Y,{throwIfNoEntry:!1});if(!Z||!Z.isFile())throw new W(`Not a valid file: ${Y}`);return Y})}function P(z){const H=(z instanceof Error?z.message:String(z)).toLowerCase();return H.includes("unknown action")||H.includes("not supported")||H.includes("inserttext returned no inserted flag")}async function T(z){return z.evaluate(`(() => {
|
|
2
|
+
const visible = (el) => !!el && (el.offsetParent !== null || el.getClientRects().length > 0);
|
|
3
|
+
const boxes = Array.from(document.querySelectorAll('[data-testid="tweetTextarea_0"]'));
|
|
4
|
+
const box = boxes.find(visible) || boxes[0];
|
|
5
|
+
if (!box) return { ok: false, message: 'Could not find the tweet composer text area. Are you logged in?' };
|
|
6
|
+
box.focus();
|
|
7
|
+
return { ok: true };
|
|
8
|
+
})()`)}async function l(z,Q){const H=Math.ceil(c/f);return z.evaluate(`(async () => {
|
|
9
|
+
const expected = ${JSON.stringify(Q)};
|
|
10
|
+
const normalize = s => String(s || '').replace(/ /g, ' ').replace(/s+/g, ' ').trim();
|
|
11
|
+
const normalizedExpected = normalize(expected);
|
|
12
|
+
for (let i = 0; i < ${JSON.stringify(H)}; i++) {
|
|
13
|
+
const box = document.querySelector('[data-testid="tweetTextarea_0"]');
|
|
14
|
+
const actual = box ? (box.innerText || box.textContent || '') : '';
|
|
15
|
+
if (box && normalize(actual).includes(normalizedExpected)) return { ok: true };
|
|
16
|
+
await new Promise(r => setTimeout(r, ${JSON.stringify(f)}));
|
|
17
|
+
}
|
|
18
|
+
const box = document.querySelector('[data-testid="tweetTextarea_0"]');
|
|
19
|
+
return {
|
|
20
|
+
ok: false,
|
|
21
|
+
message: 'Could not verify tweet text in the composer after typing.',
|
|
22
|
+
actualText: box ? (box.innerText || box.textContent || '') : ''
|
|
23
|
+
};
|
|
24
|
+
})()`)}async function E(z,Q){const H=await T(z);if(!H?.ok)return H;const Y=[z.nativeType?.bind(z),z.insertText?.bind(z)].filter(Boolean);for(const $ of Y)try{await $(Q);const Z=await l(z,Q);if(Z?.ok)return Z}catch(Z){if(!P(Z))throw Z}return z.evaluate(`(async () => {
|
|
25
|
+
try {
|
|
26
|
+
const visible = (el) => !!el && (el.offsetParent !== null || el.getClientRects().length > 0);
|
|
27
|
+
const boxes = Array.from(document.querySelectorAll('[data-testid="tweetTextarea_0"]'));
|
|
28
|
+
const box = boxes.find(visible) || boxes[0];
|
|
29
|
+
if (!box) return { ok: false, message: 'Could not find the tweet composer text area. Are you logged in?' };
|
|
30
|
+
const textToInsert = ${JSON.stringify(Q)};
|
|
31
|
+
const normalize = s => String(s || '').replace(/ /g, ' ').replace(/s+/g, ' ').trim();
|
|
32
|
+
box.focus();
|
|
33
|
+
if (!document.execCommand('insertText', false, textToInsert)) {
|
|
34
|
+
const dt = new DataTransfer();
|
|
35
|
+
dt.setData('text/plain', textToInsert);
|
|
36
|
+
box.dispatchEvent(new ClipboardEvent('paste', { clipboardData: dt, bubbles: true, cancelable: true }));
|
|
37
|
+
}
|
|
38
|
+
await new Promise(r => setTimeout(r, 500));
|
|
39
|
+
const actual = box.innerText || box.textContent || '';
|
|
40
|
+
if (normalize(actual).includes(normalize(textToInsert))) return { ok: true };
|
|
41
|
+
return { ok: false, message: 'Could not verify tweet text in the composer after typing.', actualText: actual };
|
|
42
|
+
} catch (e) { return { ok: false, message: String(e) }; }
|
|
43
|
+
})()`)}async function n(z,Q){const H=Math.ceil(F/N);return z.evaluate(`(async () => {
|
|
44
|
+
const expected = ${JSON.stringify(Q)};
|
|
45
|
+
const visible = (el) => !!el && (el.offsetParent !== null || el.getClientRects().length > 0);
|
|
46
|
+
for (let i = 0; i < ${JSON.stringify(H)}; i++) {
|
|
47
|
+
await new Promise(r => setTimeout(r, ${JSON.stringify(N)}));
|
|
48
|
+
const attachments = document.querySelector('[data-testid="attachments"]');
|
|
49
|
+
const previewCount = Math.max(
|
|
50
|
+
attachments ? attachments.querySelectorAll('[role="group"], img, video').length : 0,
|
|
51
|
+
document.querySelectorAll('[data-testid="tweetPhoto"], img[src^="blob:"], video[src^="blob:"]').length,
|
|
52
|
+
Array.from(document.querySelectorAll('button,[role="button"]')).filter((el) =>
|
|
53
|
+
/remove media|remove image|remove/i.test((el.getAttribute('aria-label') || '') + ' ' + (el.textContent || ''))
|
|
54
|
+
).length
|
|
55
|
+
);
|
|
56
|
+
const button = Array.from(document.querySelectorAll('[data-testid="tweetButtonInline"], [data-testid="tweetButton"]'))
|
|
57
|
+
.find((el) => visible(el));
|
|
58
|
+
const buttonReady = !!button && !button.disabled && button.getAttribute('aria-disabled') !== 'true';
|
|
59
|
+
if (previewCount >= expected && buttonReady) return { ok: true, previewCount };
|
|
60
|
+
}
|
|
61
|
+
return { ok: false, message: 'Image upload timed out (${F/1000}s).' };
|
|
62
|
+
})()`)}async function A(z,Q){const H=Q.map(($)=>{const Z=X.extname($).toLowerCase(),V=Z===".png"?"image/png":Z===".gif"?"image/gif":Z===".webp"?"image/webp":"image/jpeg";return{name:X.basename($),mime:V,base64:B.readFileSync($).toString("base64")}}),Y=await z.evaluate(`(() => {
|
|
63
|
+
const input = document.querySelector(${JSON.stringify(J)});
|
|
64
|
+
if (!input) return { ok: false, error: 'No file input found' };
|
|
65
|
+
const dt = new DataTransfer();
|
|
66
|
+
for (const file of ${JSON.stringify(H)}) {
|
|
67
|
+
const bin = atob(file.base64);
|
|
68
|
+
const bytes = new Uint8Array(bin.length);
|
|
69
|
+
for (let i = 0; i < bin.length; i++) bytes[i] = bin.charCodeAt(i);
|
|
70
|
+
dt.items.add(new File([bytes], file.name, { type: file.mime }));
|
|
71
|
+
}
|
|
72
|
+
let assigned = false;
|
|
73
|
+
try {
|
|
74
|
+
Object.defineProperty(input, 'files', { value: dt.files, writable: false, configurable: true });
|
|
75
|
+
assigned = input.files && input.files.length >= ${JSON.stringify(Q.length)};
|
|
76
|
+
} catch(e) {
|
|
77
|
+
try {
|
|
78
|
+
const nativeInputFileSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'files');
|
|
79
|
+
if (nativeInputFileSetter && nativeInputFileSetter.set) {
|
|
80
|
+
nativeInputFileSetter.set.call(input, dt.files);
|
|
81
|
+
assigned = input.files && input.files.length >= ${JSON.stringify(Q.length)};
|
|
82
|
+
}
|
|
83
|
+
} catch(e2) { /* ignore */ }
|
|
84
|
+
}
|
|
85
|
+
if (!assigned) return { ok: false, error: 'Could not assign files to input' };
|
|
86
|
+
input.dispatchEvent(new Event('change', { bubbles: true }));
|
|
87
|
+
input.dispatchEvent(new Event('input', { bubbles: true }));
|
|
88
|
+
return { ok: true };
|
|
89
|
+
})()`);if(!Y?.ok)throw new W(`Image upload failed (base64 fallback): ${Y?.error??"unknown error"}`)}async function u(z,Q){const H=Math.ceil(y/j),Y=await z.evaluate(`(async () => {
|
|
90
|
+
try {
|
|
91
|
+
const visible = (el) => !!el && (el.offsetParent !== null || el.getClientRects().length > 0);
|
|
92
|
+
// For text-only posts the Tweet button only becomes enabled once
|
|
93
|
+
// Draft.js has propagated the inserted text into composer state, which
|
|
94
|
+
// can lag the prior insert/verify step. A single find misfires on
|
|
95
|
+
// slow renders with "Tweet button is disabled or not found." Poll for
|
|
96
|
+
// a visible, enabled button before clicking.
|
|
97
|
+
let btn;
|
|
98
|
+
for (let i = 0; i < ${JSON.stringify(H)}; i++) {
|
|
99
|
+
const buttons = Array.from(document.querySelectorAll('[data-testid="tweetButtonInline"], [data-testid="tweetButton"]'));
|
|
100
|
+
btn = buttons.find((el) => visible(el) && !el.disabled && el.getAttribute('aria-disabled') !== 'true');
|
|
101
|
+
if (btn) break;
|
|
102
|
+
await new Promise(r => setTimeout(r, ${JSON.stringify(j)}));
|
|
103
|
+
}
|
|
104
|
+
if (!btn) return { ok: false, message: 'Tweet button is disabled or not found.' };
|
|
105
|
+
btn.click();
|
|
106
|
+
return { ok: true };
|
|
107
|
+
} catch (e) { return { ok: false, message: String(e) }; }
|
|
108
|
+
})()`);if(!Y?.ok)return Y;const $=Math.ceil(y/j);return z.evaluate(`(async () => {
|
|
109
|
+
const expected = ${JSON.stringify(Q)};
|
|
110
|
+
const normalize = s => String(s || '').replace(/ /g, ' ').replace(/s+/g, ' ').trim();
|
|
111
|
+
const expectedText = normalize(expected);
|
|
112
|
+
const visible = (el) => !!el && (el.offsetParent !== null || el.getClientRects().length > 0);
|
|
113
|
+
const statusUrl = (root = document) => {
|
|
114
|
+
const links = Array.from(root.querySelectorAll('a[href*="/status/"]'));
|
|
115
|
+
for (const link of links) {
|
|
116
|
+
const href = link.href || link.getAttribute('href') || '';
|
|
117
|
+
if (!href) continue;
|
|
118
|
+
try {
|
|
119
|
+
const url = new URL(href, window.location.origin);
|
|
120
|
+
const match = url.pathname.match(/^\\/(?:[^/]+|i)\\/status\\/(\\d+)/);
|
|
121
|
+
if (match) return { url: url.href, id: match[1] };
|
|
122
|
+
} catch {}
|
|
123
|
+
}
|
|
124
|
+
return {};
|
|
125
|
+
};
|
|
126
|
+
for (let i = 0; i < ${JSON.stringify($)}; i++) {
|
|
127
|
+
await new Promise(r => setTimeout(r, ${JSON.stringify(j)}));
|
|
128
|
+
const toasts = Array.from(document.querySelectorAll('[role="alert"], [data-testid="toast"]'))
|
|
129
|
+
.filter((el) => visible(el));
|
|
130
|
+
const successToast = toasts.find((el) => /sent|posted|your post was sent|your tweet was sent/i.test(el.textContent || ''));
|
|
131
|
+
if (successToast) return { ok: true, message: 'Tweet posted successfully.', ...statusUrl(successToast) };
|
|
132
|
+
const alert = toasts.find((el) => /failed|error|try again|not sent|could not/i.test(el.textContent || ''));
|
|
133
|
+
if (alert) return { ok: false, message: (alert.textContent || 'Tweet failed to post.').trim() };
|
|
134
|
+
|
|
135
|
+
const boxes = Array.from(document.querySelectorAll('[data-testid="tweetTextarea_0"]')).filter(visible);
|
|
136
|
+
const composerStillHasText = boxes.some((box) => normalize(box.innerText || box.textContent || '').includes(expectedText));
|
|
137
|
+
// Drop the global tweetPhoto query: tweetPhoto exists for every
|
|
138
|
+
// timeline tweet's image and would pin hasMedia true past the
|
|
139
|
+
// success path. attachments + blob: URLs are composer-only.
|
|
140
|
+
const hasMedia = !!document.querySelector('[data-testid="attachments"]')
|
|
141
|
+
|| document.querySelectorAll('img[src^="blob:"], video[src^="blob:"]').length > 0;
|
|
142
|
+
if (!composerStillHasText && !hasMedia) {
|
|
143
|
+
return { ok: true, message: 'Tweet posted successfully.', ...statusUrl() };
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return { ok: false, message: 'Tweet submission did not complete before timeout.' };
|
|
147
|
+
})()`)}function R(z){const Q=Array.isArray(z?.errors)?z.errors:[];if(Q.length===0)return"";return Q.map((H)=>H?.message||JSON.stringify(H)).filter(Boolean).join("; ").slice(0,300)}function i(z){const Q=z?.data?.create_tweet?.tweet_results?.result,H=Q?.tweet||Q;if(!H||typeof H!=="object")return null;const Y=String(H.rest_id||H.legacy?.id_str||"").trim();if(!/^\d+$/.test(Y))return null;const $=H.core?.user_results?.result,Z=String($?.core?.screen_name||$?.legacy?.screen_name||"").trim();return{id:Y,url:Z?`https://x.com/${Z}/status/${Y}`:`https://x.com/i/status/${Y}`}}async function g(z,Q){await z.goto(x,{waitUntil:"load",settleMs:1000});const Y=(await z.getCookies({url:"https://x.com"})).find((G)=>G.name==="ct0")?.value||null;if(!Y)throw new D("x.com","Not logged into x.com (no ct0 cookie)");const $=await I(z,"CreateTweet",_),Z={variables:{tweet_text:Q,dark_request:!1,media:{media_entities:[],possibly_sensitive:!1},semantic_annotation_ids:[]},features:$.features,queryId:$.queryId};if($.fieldToggles&&Object.keys($.fieldToggles).length>0)Z.fieldToggles=$.fieldToggles;const V=JSON.stringify({Authorization:`Bearer ${decodeURIComponent(M)}`,"X-Csrf-Token":Y,"X-Twitter-Auth-Type":"OAuth2Session","X-Twitter-Active-User":"yes","Content-Type":"application/json"}),K=`/i/api/graphql/${$.queryId}/CreateTweet`,w=JSON.stringify(Z),q=b(await z.evaluate(`async () => {
|
|
148
|
+
const r = await fetch(${JSON.stringify(K)}, {
|
|
149
|
+
method: 'POST',
|
|
150
|
+
headers: ${V},
|
|
151
|
+
credentials: 'include',
|
|
152
|
+
body: ${JSON.stringify(w)},
|
|
153
|
+
});
|
|
154
|
+
const bodyText = await r.text();
|
|
155
|
+
let bodyJson = null;
|
|
156
|
+
try { bodyJson = JSON.parse(bodyText); } catch {}
|
|
157
|
+
return { ok: r.ok, httpStatus: r.status, bodyJson, bodyText };
|
|
158
|
+
}`));if(q?.httpStatus===401||q?.httpStatus===403)throw new D("x.com",`Twitter CreateTweet returned HTTP ${q.httpStatus}`);if(!q?.ok){const G=R(q?.bodyJson);return{ok:!1,message:L("CreateTweet",q?.httpStatus??0,G||void 0)}}const v=i(q.bodyJson);if(!v){const G=R(q.bodyJson);return{ok:!1,message:G?`CreateTweet failed: ${G}`:"CreateTweet returned no created tweet id."}}return{ok:!0,message:"Tweet posted successfully.",...v}}C({site:"twitter",name:"post",access:"write",description:"Post a new tweet/thread",domain:"x.com",strategy:U.UI,browser:!0,args:[{name:"text",type:"string",required:!0,positional:!0,help:"The text content of the tweet"},{name:"images",type:"string",required:!1,help:"Image paths, comma-separated, max 4 (jpg/png/gif/webp)"}],columns:["status","message","text","id","url"],func:async(z,Q)=>{if(!z)throw new W("Browser session required for twitter post");const H=Q.images?d(String(Q.images)):[],Y=String(Q.text??"");S(Y,{label:"推文内容"});try{await z.goto(O,{waitUntil:"load",settleMs:2500});await z.wait({selector:'[data-testid="tweetTextarea_0"]',timeout:15})}catch(V){if(H.length>0)throw V;const K=await g(z,Y);if(!K?.ok)throw new W(K?.message??"Tweet failed to post.");return[{status:"success",message:K?.message??"Tweet posted.",text:Y,...K?.id?{id:K.id}:{},...K?.url?{url:K.url}:{}}]}if(H.length>0){await z.wait({selector:J,timeout:20});if(z.setFileInput)try{await z.setFileInput(H,J)}catch(K){if(!m(K))throw K;await A(z,H)}else await A(z,H);const V=await n(z,H.length);if(!V?.ok)throw new W(V?.message??`Image upload timed out (${F/1000}s).`)}const $=await E(z,Y);if(!$?.ok)throw new W($?.message??"Could not type tweet text.");await z.wait(1);const Z=await u(z,Y);if(!Z?.ok)throw new W(Z?.message??"Tweet was not confirmed sent; verify via readback before retrying.");return[{status:"success",message:Z?.message??"Tweet posted.",text:Y,...Z?.id?{id:Z.id}:{},...Z?.url?{url:Z.url}:{}}]}});
|