@jackwener/opencli 1.6.9 → 1.7.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/README.md +128 -59
- package/README.zh-CN.md +134 -78
- package/dist/clis/_shared/common.d.ts +3 -0
- package/dist/clis/_shared/common.js +22 -0
- package/dist/clis/bilibili/hot.js +35 -0
- package/dist/clis/bluesky/feeds.d.ts +1 -0
- package/dist/clis/bluesky/feeds.js +27 -0
- package/dist/clis/bluesky/followers.d.ts +1 -0
- package/dist/clis/bluesky/followers.js +27 -0
- package/dist/clis/bluesky/following.d.ts +1 -0
- package/dist/clis/bluesky/following.js +27 -0
- package/dist/clis/bluesky/profile.d.ts +1 -0
- package/dist/clis/bluesky/profile.js +29 -0
- package/dist/clis/bluesky/search.d.ts +1 -0
- package/dist/clis/bluesky/search.js +28 -0
- package/dist/clis/bluesky/starter-packs.d.ts +1 -0
- package/dist/clis/bluesky/starter-packs.js +28 -0
- package/dist/clis/bluesky/thread.d.ts +1 -0
- package/dist/clis/bluesky/thread.js +30 -0
- package/dist/clis/bluesky/trending.d.ts +1 -0
- package/dist/clis/bluesky/trending.js +19 -0
- package/dist/clis/bluesky/user.d.ts +1 -0
- package/dist/clis/bluesky/user.js +33 -0
- package/dist/clis/cnki/search.d.ts +1 -0
- package/dist/clis/cnki/search.js +60 -0
- package/dist/clis/cnki/search.test.d.ts +1 -0
- package/dist/clis/cnki/search.test.js +18 -0
- package/dist/clis/devto/tag.d.ts +1 -0
- package/dist/clis/devto/tag.js +32 -0
- package/dist/clis/devto/top.d.ts +1 -0
- package/dist/clis/devto/top.js +26 -0
- package/dist/clis/devto/user.d.ts +1 -0
- package/dist/clis/devto/user.js +31 -0
- package/dist/clis/dictionary/examples.d.ts +1 -0
- package/dist/clis/dictionary/examples.js +27 -0
- package/dist/clis/dictionary/search.d.ts +1 -0
- package/dist/clis/dictionary/search.js +29 -0
- package/dist/clis/dictionary/synonyms.d.ts +1 -0
- package/dist/clis/dictionary/synonyms.js +27 -0
- package/dist/clis/douban/subject.d.ts +1 -0
- package/dist/clis/douban/subject.js +118 -0
- package/dist/clis/douban/top250.d.ts +1 -0
- package/dist/clis/douban/top250.js +67 -0
- package/dist/clis/facebook/add-friend.d.ts +1 -0
- package/dist/clis/facebook/add-friend.js +43 -0
- package/dist/clis/facebook/events.d.ts +1 -0
- package/dist/clis/facebook/events.js +40 -0
- package/dist/clis/facebook/feed.d.ts +1 -0
- package/dist/clis/facebook/feed.js +59 -0
- package/dist/clis/facebook/friends.d.ts +1 -0
- package/dist/clis/facebook/friends.js +38 -0
- package/dist/clis/facebook/groups.d.ts +1 -0
- package/dist/clis/facebook/groups.js +46 -0
- package/dist/clis/facebook/join-group.d.ts +1 -0
- package/dist/clis/facebook/join-group.js +44 -0
- package/dist/clis/facebook/memories.d.ts +1 -0
- package/dist/clis/facebook/memories.js +35 -0
- package/dist/clis/facebook/notifications.d.ts +1 -0
- package/dist/clis/facebook/notifications.js +36 -0
- package/dist/clis/facebook/profile.d.ts +1 -0
- package/dist/clis/facebook/profile.js +37 -0
- package/dist/clis/facebook/search.d.ts +1 -0
- package/dist/clis/facebook/search.js +38 -0
- package/dist/clis/facebook/search.test.d.ts +1 -1
- package/dist/clis/facebook/search.test.js +6 -9
- package/dist/clis/gitee/index.d.ts +3 -0
- package/dist/clis/gitee/index.js +3 -0
- package/dist/clis/gitee/search.d.ts +1 -0
- package/dist/clis/gitee/search.js +136 -0
- package/dist/clis/gitee/trending.d.ts +1 -0
- package/dist/clis/gitee/trending.js +567 -0
- package/dist/clis/gitee/user.d.ts +1 -0
- package/dist/clis/gitee/user.js +199 -0
- package/dist/clis/gitee/user.test.d.ts +1 -0
- package/dist/clis/gitee/user.test.js +63 -0
- package/dist/clis/hackernews/ask.d.ts +1 -0
- package/dist/clis/hackernews/ask.js +29 -0
- package/dist/clis/hackernews/best.d.ts +1 -0
- package/dist/clis/hackernews/best.js +29 -0
- package/dist/clis/hackernews/jobs.d.ts +1 -0
- package/dist/clis/hackernews/jobs.js +27 -0
- package/dist/clis/hackernews/new.d.ts +1 -0
- package/dist/clis/hackernews/new.js +29 -0
- package/dist/clis/hackernews/search.d.ts +1 -0
- package/dist/clis/hackernews/search.js +36 -0
- package/dist/clis/hackernews/show.d.ts +1 -0
- package/dist/clis/hackernews/show.js +29 -0
- package/dist/clis/hackernews/top.d.ts +1 -0
- package/dist/clis/hackernews/top.js +29 -0
- package/dist/clis/hackernews/user.d.ts +1 -0
- package/dist/clis/hackernews/user.js +22 -0
- package/dist/clis/hupu/hot.d.ts +1 -0
- package/dist/clis/hupu/hot.js +40 -0
- package/dist/clis/instagram/comment.d.ts +1 -0
- package/dist/clis/instagram/comment.js +47 -0
- package/dist/clis/instagram/explore.d.ts +1 -0
- package/dist/clis/instagram/explore.js +41 -0
- package/dist/clis/instagram/follow.d.ts +1 -0
- package/dist/clis/instagram/follow.js +43 -0
- package/dist/clis/instagram/followers.d.ts +1 -0
- package/dist/clis/instagram/followers.js +45 -0
- package/dist/clis/instagram/following.d.ts +1 -0
- package/dist/clis/instagram/following.js +45 -0
- package/dist/clis/instagram/like.d.ts +1 -0
- package/dist/clis/instagram/like.js +45 -0
- package/dist/clis/instagram/profile.d.ts +1 -0
- package/dist/clis/instagram/profile.js +39 -0
- package/dist/clis/instagram/save.d.ts +1 -0
- package/dist/clis/instagram/save.js +45 -0
- package/dist/clis/instagram/saved.d.ts +1 -0
- package/dist/clis/instagram/saved.js +38 -0
- package/dist/clis/instagram/search.d.ts +1 -0
- package/dist/clis/instagram/search.js +38 -0
- package/dist/clis/instagram/unfollow.d.ts +1 -0
- package/dist/clis/instagram/unfollow.js +40 -0
- package/dist/clis/instagram/unlike.d.ts +1 -0
- package/dist/clis/instagram/unlike.js +45 -0
- package/dist/clis/instagram/unsave.d.ts +1 -0
- package/dist/clis/instagram/unsave.js +45 -0
- package/dist/clis/instagram/user.d.ts +1 -0
- package/dist/clis/instagram/user.js +48 -0
- package/dist/clis/jd/add-cart.d.ts +1 -0
- package/dist/clis/jd/add-cart.js +71 -0
- package/dist/clis/jd/cart.d.ts +1 -0
- package/dist/clis/jd/cart.js +79 -0
- package/dist/clis/jd/commands.test.d.ts +5 -0
- package/dist/clis/jd/commands.test.js +64 -0
- package/dist/clis/jd/detail.d.ts +1 -0
- package/dist/clis/jd/detail.js +62 -0
- package/dist/clis/jd/reviews.d.ts +1 -0
- package/dist/clis/jd/reviews.js +54 -0
- package/dist/clis/jd/search.d.ts +1 -0
- package/dist/clis/jd/search.js +65 -0
- package/dist/clis/jianyu/detail.d.ts +1 -0
- package/dist/clis/jianyu/detail.js +20 -0
- package/dist/clis/jianyu/search.d.ts +41 -4
- package/dist/clis/jianyu/search.js +458 -96
- package/dist/clis/jianyu/search.test.js +105 -0
- package/dist/clis/jianyu/shared/china-bid-search.d.ts +12 -0
- package/dist/clis/jianyu/shared/china-bid-search.js +165 -0
- package/dist/clis/jianyu/shared/procurement-contract.d.ts +68 -0
- package/dist/clis/jianyu/shared/procurement-contract.js +324 -0
- package/dist/clis/jianyu/shared/procurement-contract.test.d.ts +1 -0
- package/dist/clis/jianyu/shared/procurement-contract.test.js +72 -0
- package/dist/clis/jianyu/shared/procurement-detail.d.ts +6 -0
- package/dist/clis/jianyu/shared/procurement-detail.js +92 -0
- package/dist/clis/jianyu/shared/procurement-detail.test.d.ts +1 -0
- package/dist/clis/jianyu/shared/procurement-detail.test.js +72 -0
- package/dist/clis/jike/post.d.ts +1 -0
- package/dist/clis/jike/post.js +61 -0
- package/dist/clis/jike/topic.d.ts +1 -0
- package/dist/clis/jike/topic.js +51 -0
- package/dist/clis/jike/user.d.ts +1 -0
- package/dist/clis/jike/user.js +50 -0
- package/dist/clis/jimeng/generate.d.ts +1 -0
- package/dist/clis/jimeng/generate.js +83 -0
- package/dist/clis/jimeng/history.d.ts +1 -0
- package/dist/clis/jimeng/history.js +47 -0
- package/dist/clis/jimeng/new.d.ts +1 -0
- package/dist/clis/jimeng/new.js +43 -0
- package/dist/clis/jimeng/workspaces.d.ts +1 -0
- package/dist/clis/jimeng/workspaces.js +41 -0
- package/dist/clis/linux-do/categories.d.ts +1 -0
- package/dist/clis/linux-do/categories.js +65 -0
- package/dist/clis/linux-do/search.d.ts +1 -0
- package/dist/clis/linux-do/search.js +41 -0
- package/dist/clis/linux-do/tags.d.ts +1 -0
- package/dist/clis/linux-do/tags.js +39 -0
- package/dist/clis/linux-do/topic-content.test.js +5 -5
- package/dist/clis/linux-do/topic.d.ts +1 -0
- package/dist/clis/linux-do/topic.js +56 -0
- package/dist/clis/linux-do/user-posts.d.ts +1 -0
- package/dist/clis/linux-do/user-posts.js +61 -0
- package/dist/clis/linux-do/user-topics.d.ts +1 -0
- package/dist/clis/linux-do/user-topics.js +48 -0
- package/dist/clis/lobsters/active.d.ts +1 -0
- package/dist/clis/lobsters/active.js +26 -0
- package/dist/clis/lobsters/hot.d.ts +1 -0
- package/dist/clis/lobsters/hot.js +26 -0
- package/dist/clis/lobsters/newest.d.ts +1 -0
- package/dist/clis/lobsters/newest.js +26 -0
- package/dist/clis/lobsters/tag.d.ts +1 -0
- package/dist/clis/lobsters/tag.js +32 -0
- package/dist/clis/pixiv/detail.d.ts +1 -0
- package/dist/clis/pixiv/detail.js +58 -0
- package/dist/clis/pixiv/ranking.d.ts +1 -0
- package/dist/clis/pixiv/ranking.js +59 -0
- package/dist/clis/pixiv/user.d.ts +1 -0
- package/dist/clis/pixiv/user.js +52 -0
- package/dist/clis/reddit/frontpage.d.ts +1 -0
- package/dist/clis/reddit/frontpage.js +31 -0
- package/dist/clis/reddit/hot.d.ts +1 -0
- package/dist/clis/reddit/hot.js +45 -0
- package/dist/clis/reddit/popular.d.ts +1 -0
- package/dist/clis/reddit/popular.js +41 -0
- package/dist/clis/reddit/search.d.ts +1 -0
- package/dist/clis/reddit/search.js +65 -0
- package/dist/clis/reddit/subreddit.d.ts +1 -0
- package/dist/clis/reddit/subreddit.js +52 -0
- package/dist/clis/reddit/user-comments.d.ts +1 -0
- package/dist/clis/reddit/user-comments.js +44 -0
- package/dist/clis/reddit/user-posts.d.ts +1 -0
- package/dist/clis/reddit/user-posts.js +42 -0
- package/dist/clis/reddit/user.d.ts +1 -0
- package/dist/clis/reddit/user.js +37 -0
- package/dist/clis/stackoverflow/bounties.d.ts +1 -0
- package/dist/clis/stackoverflow/bounties.js +27 -0
- package/dist/clis/stackoverflow/hot.d.ts +1 -0
- package/dist/clis/stackoverflow/hot.js +24 -0
- package/dist/clis/stackoverflow/search.d.ts +1 -0
- package/dist/clis/stackoverflow/search.js +27 -0
- package/dist/clis/stackoverflow/unanswered.d.ts +1 -0
- package/dist/clis/stackoverflow/unanswered.js +26 -0
- package/dist/clis/steam/top-sellers.d.ts +1 -0
- package/dist/clis/steam/top-sellers.js +25 -0
- package/dist/clis/taobao/add-cart.d.ts +1 -0
- package/dist/clis/taobao/add-cart.js +149 -0
- package/dist/clis/taobao/cart.d.ts +1 -0
- package/dist/clis/taobao/cart.js +95 -0
- package/dist/clis/taobao/commands.test.d.ts +5 -0
- package/dist/clis/taobao/commands.test.js +64 -0
- package/dist/clis/taobao/detail.d.ts +1 -0
- package/dist/clis/taobao/detail.js +70 -0
- package/dist/clis/taobao/reviews.d.ts +1 -0
- package/dist/clis/taobao/reviews.js +76 -0
- package/dist/clis/taobao/search.d.ts +1 -0
- package/dist/clis/taobao/search.js +96 -0
- package/dist/clis/tiktok/comment.d.ts +1 -0
- package/dist/clis/tiktok/comment.js +57 -0
- package/dist/clis/tiktok/explore.d.ts +1 -0
- package/dist/clis/tiktok/explore.js +35 -0
- package/dist/clis/tiktok/follow.d.ts +1 -0
- package/dist/clis/tiktok/follow.js +39 -0
- package/dist/clis/tiktok/following.d.ts +1 -0
- package/dist/clis/tiktok/following.js +42 -0
- package/dist/clis/tiktok/friends.d.ts +1 -0
- package/dist/clis/tiktok/friends.js +43 -0
- package/dist/clis/tiktok/like.d.ts +1 -0
- package/dist/clis/tiktok/like.js +33 -0
- package/dist/clis/tiktok/live.d.ts +1 -0
- package/dist/clis/tiktok/live.js +47 -0
- package/dist/clis/tiktok/notifications.d.ts +1 -0
- package/dist/clis/tiktok/notifications.js +49 -0
- package/dist/clis/tiktok/profile.d.ts +1 -0
- package/dist/clis/tiktok/profile.js +54 -0
- package/dist/clis/tiktok/save.d.ts +1 -0
- package/dist/clis/tiktok/save.js +29 -0
- package/dist/clis/tiktok/search.d.ts +1 -0
- package/dist/clis/tiktok/search.js +39 -0
- package/dist/clis/tiktok/unfollow.d.ts +1 -0
- package/dist/clis/tiktok/unfollow.js +44 -0
- package/dist/clis/tiktok/unlike.d.ts +1 -0
- package/dist/clis/tiktok/unlike.js +33 -0
- package/dist/clis/tiktok/unsave.d.ts +1 -0
- package/dist/clis/tiktok/unsave.js +31 -0
- package/dist/clis/tiktok/user.d.ts +1 -0
- package/dist/clis/tiktok/user.js +41 -0
- package/dist/clis/v2ex/hot.d.ts +1 -0
- package/dist/clis/v2ex/hot.js +25 -0
- package/dist/clis/v2ex/latest.d.ts +1 -0
- package/dist/clis/v2ex/latest.js +25 -0
- package/dist/clis/v2ex/member.d.ts +1 -0
- package/dist/clis/v2ex/member.js +27 -0
- package/dist/clis/v2ex/node.d.ts +1 -0
- package/dist/clis/v2ex/node.js +38 -0
- package/dist/clis/v2ex/nodes.d.ts +1 -0
- package/dist/clis/v2ex/nodes.js +25 -0
- package/dist/clis/v2ex/replies.d.ts +1 -0
- package/dist/clis/v2ex/replies.js +26 -0
- package/dist/clis/v2ex/topic.d.ts +1 -0
- package/dist/clis/v2ex/topic.js +30 -0
- package/dist/clis/v2ex/user.d.ts +1 -0
- package/dist/clis/v2ex/user.js +33 -0
- package/dist/clis/xiaoe/catalog.d.ts +1 -0
- package/dist/clis/xiaoe/catalog.js +161 -0
- package/dist/clis/xiaoe/content.d.ts +1 -0
- package/dist/clis/xiaoe/content.js +39 -0
- package/dist/clis/xiaoe/courses.d.ts +1 -0
- package/dist/clis/xiaoe/courses.js +69 -0
- package/dist/clis/xiaoe/detail.d.ts +1 -0
- package/dist/clis/xiaoe/detail.js +35 -0
- package/dist/clis/xiaoe/play-url.d.ts +1 -0
- package/dist/clis/xiaoe/play-url.js +120 -0
- package/dist/clis/xiaohongshu/feed.d.ts +1 -0
- package/dist/clis/xiaohongshu/feed.js +32 -0
- package/dist/clis/xiaohongshu/notifications.d.ts +1 -0
- package/dist/clis/xiaohongshu/notifications.js +38 -0
- package/dist/clis/xueqiu/earnings-date.d.ts +1 -0
- package/dist/clis/xueqiu/earnings-date.js +61 -0
- package/dist/clis/xueqiu/feed.d.ts +1 -0
- package/dist/clis/xueqiu/feed.js +48 -0
- package/dist/clis/xueqiu/groups.d.ts +1 -0
- package/dist/clis/xueqiu/groups.js +25 -0
- package/dist/clis/xueqiu/hot-stock.d.ts +1 -0
- package/dist/clis/xueqiu/hot-stock.js +44 -0
- package/dist/clis/xueqiu/hot.d.ts +1 -0
- package/dist/clis/xueqiu/hot.js +44 -0
- package/dist/clis/xueqiu/kline.d.ts +1 -0
- package/dist/clis/xueqiu/kline.js +64 -0
- package/dist/clis/xueqiu/search.d.ts +1 -0
- package/dist/clis/xueqiu/search.js +49 -0
- package/dist/clis/xueqiu/stock.d.ts +1 -0
- package/dist/clis/xueqiu/stock.js +72 -0
- package/dist/clis/xueqiu/watchlist.d.ts +1 -0
- package/dist/clis/xueqiu/watchlist.js +45 -0
- package/dist/clis/zhihu/hot.d.ts +1 -0
- package/dist/clis/zhihu/hot.js +43 -0
- package/dist/clis/zhihu/search.d.ts +1 -0
- package/dist/clis/zhihu/search.js +52 -0
- package/dist/src/browser/bridge.js +1 -1
- package/dist/src/browser/daemon-client.d.ts +16 -4
- package/dist/src/browser/daemon-client.js +33 -15
- package/dist/src/browser/daemon-client.test.js +0 -3
- package/dist/src/browser/dom-helpers.test.js +3 -2
- package/dist/src/browser/errors.d.ts +26 -1
- package/dist/src/browser/errors.js +40 -7
- package/dist/src/browser/errors.test.d.ts +1 -0
- package/dist/src/browser/errors.test.js +51 -0
- package/dist/src/browser/page.d.ts +9 -8
- package/dist/src/browser/page.js +33 -31
- package/dist/src/browser.test.js +25 -6
- package/dist/src/build-manifest.d.ts +5 -11
- package/dist/src/build-manifest.js +6 -75
- package/dist/src/build-manifest.test.js +1 -39
- package/dist/src/cascade.js +3 -2
- package/dist/src/cli.d.ts +3 -3
- package/dist/src/cli.js +71 -71
- package/dist/src/cli.test.js +20 -15
- package/dist/src/clis/binance/asks.d.ts +1 -0
- package/dist/src/clis/binance/asks.js +20 -0
- package/dist/src/clis/binance/commands.test.d.ts +3 -1
- package/dist/src/clis/binance/commands.test.js +10 -6
- package/dist/src/clis/binance/depth.d.ts +1 -0
- package/dist/src/clis/binance/depth.js +20 -0
- package/dist/src/clis/binance/gainers.d.ts +1 -0
- package/dist/src/clis/binance/gainers.js +21 -0
- package/dist/src/clis/binance/klines.d.ts +1 -0
- package/dist/src/clis/binance/klines.js +20 -0
- package/dist/src/clis/binance/losers.d.ts +1 -0
- package/dist/src/clis/binance/losers.js +21 -0
- package/dist/src/clis/binance/pairs.d.ts +1 -0
- package/dist/src/clis/binance/pairs.js +20 -0
- package/dist/src/clis/binance/price.d.ts +1 -0
- package/dist/src/clis/binance/price.js +17 -0
- package/dist/src/clis/binance/prices.d.ts +1 -0
- package/dist/src/clis/binance/prices.js +18 -0
- package/dist/src/clis/binance/ticker.d.ts +1 -0
- package/dist/src/clis/binance/ticker.js +20 -0
- package/dist/src/clis/binance/top.d.ts +1 -0
- package/dist/src/clis/binance/top.js +20 -0
- package/dist/src/clis/binance/trades.d.ts +1 -0
- package/dist/src/clis/binance/trades.js +19 -0
- package/dist/src/commands/daemon.d.ts +2 -6
- package/dist/src/commands/daemon.js +2 -58
- package/dist/src/commands/daemon.test.js +24 -120
- package/dist/src/completion-fast.d.ts +25 -0
- package/dist/src/completion-fast.js +140 -0
- package/dist/src/completion.d.ts +1 -0
- package/dist/src/completion.js +1 -0
- package/dist/src/constants.d.ts +0 -2
- package/dist/src/constants.js +0 -2
- package/dist/src/daemon.d.ts +1 -1
- package/dist/src/daemon.js +2 -15
- package/dist/src/diagnostic.test.js +2 -2
- package/dist/src/discovery.d.ts +3 -3
- package/dist/src/discovery.js +34 -97
- package/dist/src/download/index.d.ts +1 -1
- package/dist/src/engine.test.js +4 -19
- package/dist/src/execution.js +5 -1
- package/dist/src/generate-verified.d.ts +105 -0
- package/dist/src/generate-verified.js +696 -0
- package/dist/src/generate-verified.test.d.ts +1 -0
- package/dist/src/generate-verified.test.js +925 -0
- package/dist/src/generate.d.ts +9 -1
- package/dist/src/generate.js +2 -2
- package/dist/src/main.js +65 -12
- package/dist/src/pipeline/steps/download.d.ts +1 -17
- package/dist/src/pipeline/steps/download.js +20 -31
- package/dist/src/pipeline/steps/intercept.d.ts +1 -1
- package/dist/src/pipeline/steps/intercept.js +1 -1
- package/dist/src/pipeline/steps/tap.d.ts +1 -1
- package/dist/src/pipeline/steps/tap.js +1 -1
- package/dist/src/plugin-scaffold.d.ts +2 -2
- package/dist/src/plugin-scaffold.js +24 -21
- package/dist/src/plugin-scaffold.test.js +1 -1
- package/dist/src/plugin.d.ts +1 -1
- package/dist/src/plugin.js +4 -6
- package/dist/src/plugin.test.js +31 -31
- package/dist/src/record.js +26 -25
- package/dist/src/runtime-detect.js +3 -7
- package/dist/src/scripts/framework.d.ts +3 -0
- package/dist/src/scripts/framework.js +8 -4
- package/dist/src/scripts/store.d.ts +5 -1
- package/dist/src/scripts/store.js +5 -1
- package/dist/src/skill-generate.d.ts +30 -0
- package/dist/src/skill-generate.js +75 -0
- package/dist/src/skill-generate.test.d.ts +1 -0
- package/dist/src/skill-generate.test.js +173 -0
- package/dist/src/synthesize.d.ts +1 -1
- package/dist/src/synthesize.js +7 -8
- package/dist/src/types.d.ts +3 -1
- package/package.json +4 -3
- package/dist/clis/bilibili/hot.yaml +0 -38
- package/dist/clis/bluesky/feeds.yaml +0 -29
- package/dist/clis/bluesky/followers.yaml +0 -33
- package/dist/clis/bluesky/following.yaml +0 -33
- package/dist/clis/bluesky/profile.yaml +0 -27
- package/dist/clis/bluesky/search.yaml +0 -34
- package/dist/clis/bluesky/starter-packs.yaml +0 -34
- package/dist/clis/bluesky/thread.yaml +0 -32
- package/dist/clis/bluesky/trending.yaml +0 -27
- package/dist/clis/bluesky/user.yaml +0 -34
- package/dist/clis/devto/tag.yaml +0 -34
- package/dist/clis/devto/top.yaml +0 -29
- package/dist/clis/devto/user.yaml +0 -33
- package/dist/clis/dictionary/examples.yaml +0 -25
- package/dist/clis/dictionary/search.yaml +0 -27
- package/dist/clis/dictionary/synonyms.yaml +0 -25
- package/dist/clis/douban/subject.yaml +0 -107
- package/dist/clis/douban/top250.yaml +0 -70
- package/dist/clis/facebook/add-friend.yaml +0 -43
- package/dist/clis/facebook/events.yaml +0 -44
- package/dist/clis/facebook/feed.yaml +0 -63
- package/dist/clis/facebook/friends.yaml +0 -42
- package/dist/clis/facebook/groups.yaml +0 -50
- package/dist/clis/facebook/join-group.yaml +0 -44
- package/dist/clis/facebook/memories.yaml +0 -39
- package/dist/clis/facebook/notifications.yaml +0 -40
- package/dist/clis/facebook/profile.yaml +0 -37
- package/dist/clis/facebook/search.yaml +0 -47
- package/dist/clis/hackernews/ask.yaml +0 -38
- package/dist/clis/hackernews/best.yaml +0 -38
- package/dist/clis/hackernews/jobs.yaml +0 -36
- package/dist/clis/hackernews/new.yaml +0 -38
- package/dist/clis/hackernews/search.yaml +0 -44
- package/dist/clis/hackernews/show.yaml +0 -38
- package/dist/clis/hackernews/top.yaml +0 -38
- package/dist/clis/hackernews/user.yaml +0 -25
- package/dist/clis/hupu/hot.yaml +0 -43
- package/dist/clis/instagram/comment.yaml +0 -52
- package/dist/clis/instagram/explore.yaml +0 -43
- package/dist/clis/instagram/follow.yaml +0 -41
- package/dist/clis/instagram/followers.yaml +0 -51
- package/dist/clis/instagram/following.yaml +0 -51
- package/dist/clis/instagram/like.yaml +0 -46
- package/dist/clis/instagram/profile.yaml +0 -42
- package/dist/clis/instagram/save.yaml +0 -46
- package/dist/clis/instagram/saved.yaml +0 -40
- package/dist/clis/instagram/search.yaml +0 -44
- package/dist/clis/instagram/unfollow.yaml +0 -38
- package/dist/clis/instagram/unlike.yaml +0 -46
- package/dist/clis/instagram/unsave.yaml +0 -46
- package/dist/clis/instagram/user.yaml +0 -54
- package/dist/clis/jike/post.yaml +0 -59
- package/dist/clis/jike/topic.yaml +0 -53
- package/dist/clis/jike/user.yaml +0 -52
- package/dist/clis/jimeng/generate.yaml +0 -85
- package/dist/clis/jimeng/history.yaml +0 -46
- package/dist/clis/linux-do/categories.yaml +0 -70
- package/dist/clis/linux-do/search.yaml +0 -48
- package/dist/clis/linux-do/tags.yaml +0 -41
- package/dist/clis/linux-do/topic.yaml +0 -62
- package/dist/clis/linux-do/user-posts.yaml +0 -67
- package/dist/clis/linux-do/user-topics.yaml +0 -54
- package/dist/clis/lobsters/active.yaml +0 -29
- package/dist/clis/lobsters/hot.yaml +0 -29
- package/dist/clis/lobsters/newest.yaml +0 -29
- package/dist/clis/lobsters/tag.yaml +0 -34
- package/dist/clis/pixiv/detail.yaml +0 -49
- package/dist/clis/pixiv/ranking.yaml +0 -53
- package/dist/clis/pixiv/user.yaml +0 -46
- package/dist/clis/reddit/frontpage.yaml +0 -30
- package/dist/clis/reddit/hot.yaml +0 -47
- package/dist/clis/reddit/popular.yaml +0 -40
- package/dist/clis/reddit/search.yaml +0 -61
- package/dist/clis/reddit/subreddit.yaml +0 -50
- package/dist/clis/reddit/user-comments.yaml +0 -46
- package/dist/clis/reddit/user-posts.yaml +0 -44
- package/dist/clis/reddit/user.yaml +0 -40
- package/dist/clis/stackoverflow/bounties.yaml +0 -29
- package/dist/clis/stackoverflow/hot.yaml +0 -28
- package/dist/clis/stackoverflow/search.yaml +0 -33
- package/dist/clis/stackoverflow/unanswered.yaml +0 -28
- package/dist/clis/steam/top-sellers.yaml +0 -29
- package/dist/clis/tiktok/comment.yaml +0 -66
- package/dist/clis/tiktok/explore.yaml +0 -39
- package/dist/clis/tiktok/follow.yaml +0 -39
- package/dist/clis/tiktok/following.yaml +0 -46
- package/dist/clis/tiktok/friends.yaml +0 -47
- package/dist/clis/tiktok/like.yaml +0 -38
- package/dist/clis/tiktok/live.yaml +0 -51
- package/dist/clis/tiktok/notifications.yaml +0 -52
- package/dist/clis/tiktok/profile.yaml +0 -45
- package/dist/clis/tiktok/save.yaml +0 -34
- package/dist/clis/tiktok/search.yaml +0 -47
- package/dist/clis/tiktok/unfollow.yaml +0 -44
- package/dist/clis/tiktok/unlike.yaml +0 -38
- package/dist/clis/tiktok/unsave.yaml +0 -36
- package/dist/clis/tiktok/user.yaml +0 -44
- package/dist/clis/v2ex/hot.yaml +0 -28
- package/dist/clis/v2ex/latest.yaml +0 -28
- package/dist/clis/v2ex/member.yaml +0 -29
- package/dist/clis/v2ex/node.yaml +0 -34
- package/dist/clis/v2ex/nodes.yaml +0 -31
- package/dist/clis/v2ex/replies.yaml +0 -32
- package/dist/clis/v2ex/topic.yaml +0 -33
- package/dist/clis/v2ex/user.yaml +0 -34
- package/dist/clis/xiaoe/catalog.yaml +0 -129
- package/dist/clis/xiaoe/content.yaml +0 -43
- package/dist/clis/xiaoe/courses.yaml +0 -73
- package/dist/clis/xiaoe/detail.yaml +0 -39
- package/dist/clis/xiaoe/play-url.yaml +0 -124
- package/dist/clis/xiaohongshu/feed.yaml +0 -31
- package/dist/clis/xiaohongshu/notifications.yaml +0 -37
- package/dist/clis/xueqiu/earnings-date.yaml +0 -69
- package/dist/clis/xueqiu/feed.yaml +0 -53
- package/dist/clis/xueqiu/groups.yaml +0 -23
- package/dist/clis/xueqiu/hot-stock.yaml +0 -49
- package/dist/clis/xueqiu/hot.yaml +0 -46
- package/dist/clis/xueqiu/kline.yaml +0 -65
- package/dist/clis/xueqiu/search.yaml +0 -55
- package/dist/clis/xueqiu/stock.yaml +0 -69
- package/dist/clis/xueqiu/watchlist.yaml +0 -46
- package/dist/clis/zhihu/hot.yaml +0 -46
- package/dist/clis/zhihu/search.yaml +0 -59
- package/dist/src/daemon.test.js +0 -65
- package/dist/src/idle-manager.d.ts +0 -19
- package/dist/src/idle-manager.js +0 -54
- package/dist/src/yaml-schema.d.ts +0 -29
- package/dist/src/yaml-schema.js +0 -22
- /package/dist/{src/daemon.test.d.ts → clis/bilibili/hot.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'tiktok',
|
|
4
|
+
name: 'follow',
|
|
5
|
+
description: 'Follow a TikTok user',
|
|
6
|
+
domain: 'www.tiktok.com',
|
|
7
|
+
args: [
|
|
8
|
+
{
|
|
9
|
+
name: 'username',
|
|
10
|
+
required: true,
|
|
11
|
+
positional: true,
|
|
12
|
+
help: 'TikTok username (without @)',
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
columns: ['status', 'username'],
|
|
16
|
+
pipeline: [
|
|
17
|
+
{ navigate: { url: 'https://www.tiktok.com/@${{ args.username }}', settleMs: 6000 } },
|
|
18
|
+
{ evaluate: `(async () => {
|
|
19
|
+
const username = \${{ args.username | json }};
|
|
20
|
+
const buttons = Array.from(document.querySelectorAll('button, [role="button"]'));
|
|
21
|
+
const followBtn = buttons.find(function(b) {
|
|
22
|
+
var text = b.textContent.trim();
|
|
23
|
+
return text === 'Follow' || text === '关注';
|
|
24
|
+
});
|
|
25
|
+
if (!followBtn) {
|
|
26
|
+
var isFollowing = buttons.some(function(b) {
|
|
27
|
+
var t = b.textContent.trim();
|
|
28
|
+
return t === 'Following' || t === '已关注' || t === 'Friends' || t === '互关';
|
|
29
|
+
});
|
|
30
|
+
if (isFollowing) return [{ status: 'Already following', username: username }];
|
|
31
|
+
return [{ status: 'Follow button not found', username: username }];
|
|
32
|
+
}
|
|
33
|
+
followBtn.click();
|
|
34
|
+
await new Promise(r => setTimeout(r, 2000));
|
|
35
|
+
return [{ status: 'Followed', username: username }];
|
|
36
|
+
})()
|
|
37
|
+
` },
|
|
38
|
+
],
|
|
39
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'tiktok',
|
|
4
|
+
name: 'following',
|
|
5
|
+
description: 'List accounts you follow on TikTok',
|
|
6
|
+
domain: 'www.tiktok.com',
|
|
7
|
+
args: [
|
|
8
|
+
{ name: 'limit', type: 'int', default: 20, help: 'Number of accounts' },
|
|
9
|
+
],
|
|
10
|
+
columns: ['index', 'username', 'name'],
|
|
11
|
+
pipeline: [
|
|
12
|
+
{ navigate: { url: 'https://www.tiktok.com/following', settleMs: 5000 } },
|
|
13
|
+
{ evaluate: `(() => {
|
|
14
|
+
const limit = \${{ args.limit }};
|
|
15
|
+
const links = Array.from(document.querySelectorAll('a[href*="/@"]'))
|
|
16
|
+
.filter(function(a) {
|
|
17
|
+
const text = a.textContent.trim();
|
|
18
|
+
return text.length > 1 && text.length < 80 &&
|
|
19
|
+
!text.includes('Profile') && !text.includes('More') && !text.includes('Upload');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const seen = {};
|
|
23
|
+
const results = [];
|
|
24
|
+
for (const a of links) {
|
|
25
|
+
const match = a.href.match(/@([^/]+)/);
|
|
26
|
+
const username = match ? match[1] : '';
|
|
27
|
+
if (!username || seen[username]) continue;
|
|
28
|
+
seen[username] = true;
|
|
29
|
+
const raw = a.textContent.trim();
|
|
30
|
+
const name = raw.replace(username, '').replace('@', '').trim();
|
|
31
|
+
results.push({
|
|
32
|
+
index: results.length + 1,
|
|
33
|
+
username: username,
|
|
34
|
+
name: name || username,
|
|
35
|
+
});
|
|
36
|
+
if (results.length >= limit) break;
|
|
37
|
+
}
|
|
38
|
+
return results;
|
|
39
|
+
})()
|
|
40
|
+
` },
|
|
41
|
+
],
|
|
42
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'tiktok',
|
|
4
|
+
name: 'friends',
|
|
5
|
+
description: 'Get TikTok friend suggestions',
|
|
6
|
+
domain: 'www.tiktok.com',
|
|
7
|
+
args: [
|
|
8
|
+
{ name: 'limit', type: 'int', default: 20, help: 'Number of suggestions' },
|
|
9
|
+
],
|
|
10
|
+
columns: ['index', 'username', 'name'],
|
|
11
|
+
pipeline: [
|
|
12
|
+
{ navigate: { url: 'https://www.tiktok.com/friends', settleMs: 5000 } },
|
|
13
|
+
{ evaluate: `(() => {
|
|
14
|
+
const limit = \${{ args.limit }};
|
|
15
|
+
const links = Array.from(document.querySelectorAll('a[href*="/@"]'))
|
|
16
|
+
.filter(function(a) {
|
|
17
|
+
const text = a.textContent.trim();
|
|
18
|
+
return text.length > 1 && text.length < 80 &&
|
|
19
|
+
!text.includes('Profile') && !text.includes('More') && !text.includes('Upload');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const seen = {};
|
|
23
|
+
const results = [];
|
|
24
|
+
for (const a of links) {
|
|
25
|
+
const match = a.href.match(/@([^/]+)/);
|
|
26
|
+
const username = match ? match[1] : '';
|
|
27
|
+
if (!username || seen[username]) continue;
|
|
28
|
+
seen[username] = true;
|
|
29
|
+
const raw = a.textContent.trim();
|
|
30
|
+
const hasFollow = raw.includes('Follow');
|
|
31
|
+
const name = raw.replace('Follow', '').replace(username, '').replace('@', '').trim();
|
|
32
|
+
results.push({
|
|
33
|
+
index: results.length + 1,
|
|
34
|
+
username: username,
|
|
35
|
+
name: name || username,
|
|
36
|
+
});
|
|
37
|
+
if (results.length >= limit) break;
|
|
38
|
+
}
|
|
39
|
+
return results;
|
|
40
|
+
})()
|
|
41
|
+
` },
|
|
42
|
+
],
|
|
43
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'tiktok',
|
|
4
|
+
name: 'like',
|
|
5
|
+
description: 'Like a TikTok video',
|
|
6
|
+
domain: 'www.tiktok.com',
|
|
7
|
+
args: [
|
|
8
|
+
{ name: 'url', required: true, positional: true, help: 'TikTok video URL' },
|
|
9
|
+
],
|
|
10
|
+
columns: ['status', 'likes', 'url'],
|
|
11
|
+
pipeline: [
|
|
12
|
+
{ navigate: { url: '${{ args.url }}', settleMs: 6000 } },
|
|
13
|
+
{ evaluate: `(async () => {
|
|
14
|
+
const url = \${{ args.url | json }};
|
|
15
|
+
const btn = document.querySelector('[data-e2e="like-icon"]');
|
|
16
|
+
if (!btn) throw new Error('Like button not found - make sure you are logged in');
|
|
17
|
+
const container = btn.closest('button') || btn.closest('[role="button"]') || btn;
|
|
18
|
+
const aria = (container.getAttribute('aria-label') || '').toLowerCase();
|
|
19
|
+
const color = window.getComputedStyle(btn).color;
|
|
20
|
+
const isLiked = aria.includes('unlike') || aria.includes('取消点赞') ||
|
|
21
|
+
(color && (color.includes('255, 65') || color.includes('fe2c55')));
|
|
22
|
+
if (isLiked) {
|
|
23
|
+
const count = document.querySelector('[data-e2e="like-count"]');
|
|
24
|
+
return [{ status: 'Already liked', likes: count ? count.textContent.trim() : '-', url: url }];
|
|
25
|
+
}
|
|
26
|
+
container.click();
|
|
27
|
+
await new Promise(r => setTimeout(r, 2000));
|
|
28
|
+
const count = document.querySelector('[data-e2e="like-count"]');
|
|
29
|
+
return [{ status: 'Liked', likes: count ? count.textContent.trim() : '-', url: url }];
|
|
30
|
+
})()
|
|
31
|
+
` },
|
|
32
|
+
],
|
|
33
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'tiktok',
|
|
4
|
+
name: 'live',
|
|
5
|
+
description: 'Browse live streams on TikTok',
|
|
6
|
+
domain: 'www.tiktok.com',
|
|
7
|
+
args: [
|
|
8
|
+
{ name: 'limit', type: 'int', default: 10, help: 'Number of streams' },
|
|
9
|
+
],
|
|
10
|
+
columns: ['index', 'streamer', 'viewers', 'url'],
|
|
11
|
+
pipeline: [
|
|
12
|
+
{ navigate: { url: 'https://www.tiktok.com/live', settleMs: 5000 } },
|
|
13
|
+
{ evaluate: `(() => {
|
|
14
|
+
const limit = \${{ args.limit }};
|
|
15
|
+
// Sidebar live list has structured data
|
|
16
|
+
const items = document.querySelectorAll('[data-e2e="live-side-nav-item"]');
|
|
17
|
+
const sidebar = Array.from(items).slice(0, limit).map(function(el, i) {
|
|
18
|
+
const nameEl = el.querySelector('[data-e2e="live-side-nav-name"]');
|
|
19
|
+
const countEl = el.querySelector('[data-e2e="person-count"]');
|
|
20
|
+
const link = el.querySelector('a');
|
|
21
|
+
return {
|
|
22
|
+
index: i + 1,
|
|
23
|
+
streamer: nameEl ? nameEl.textContent.trim() : '',
|
|
24
|
+
viewers: countEl ? countEl.textContent.trim() : '-',
|
|
25
|
+
url: link ? link.href : '',
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
if (sidebar.length > 0) return sidebar;
|
|
30
|
+
|
|
31
|
+
// Fallback: main content cards
|
|
32
|
+
const cards = document.querySelectorAll('[data-e2e="discover-list-live-card"]');
|
|
33
|
+
return Array.from(cards).slice(0, limit).map(function(card, i) {
|
|
34
|
+
const text = card.textContent.trim().replace(/\\s+/g, ' ');
|
|
35
|
+
const link = card.querySelector('a[href*="/live"]');
|
|
36
|
+
const viewerMatch = text.match(/(\\d[\\d,.]*)\\s*watching/);
|
|
37
|
+
return {
|
|
38
|
+
index: i + 1,
|
|
39
|
+
streamer: text.replace(/LIVE.*$/, '').trim().substring(0, 40),
|
|
40
|
+
viewers: viewerMatch ? viewerMatch[1] : '-',
|
|
41
|
+
url: link ? link.href : '',
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
})()
|
|
45
|
+
` },
|
|
46
|
+
],
|
|
47
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'tiktok',
|
|
4
|
+
name: 'notifications',
|
|
5
|
+
description: 'Get TikTok notifications (likes, comments, mentions, followers)',
|
|
6
|
+
domain: 'www.tiktok.com',
|
|
7
|
+
args: [
|
|
8
|
+
{ name: 'limit', type: 'int', default: 15, help: 'Number of notifications' },
|
|
9
|
+
{
|
|
10
|
+
name: 'type',
|
|
11
|
+
default: 'all',
|
|
12
|
+
help: 'Notification type',
|
|
13
|
+
choices: ['all', 'likes', 'comments', 'mentions', 'followers'],
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
columns: ['index', 'text'],
|
|
17
|
+
pipeline: [
|
|
18
|
+
{ navigate: { url: 'https://www.tiktok.com/following', settleMs: 5000 } },
|
|
19
|
+
{ evaluate: `(async () => {
|
|
20
|
+
const limit = \${{ args.limit }};
|
|
21
|
+
const type = \${{ args.type | json }};
|
|
22
|
+
const wait = (ms) => new Promise(r => setTimeout(r, ms));
|
|
23
|
+
|
|
24
|
+
// Click inbox icon to open notifications panel
|
|
25
|
+
const inboxIcon = document.querySelector('[data-e2e="inbox-icon"]');
|
|
26
|
+
if (inboxIcon) inboxIcon.click();
|
|
27
|
+
await wait(1500);
|
|
28
|
+
|
|
29
|
+
// Click specific tab if needed
|
|
30
|
+
if (type !== 'all') {
|
|
31
|
+
const tab = document.querySelector('[data-e2e="' + type + '"]');
|
|
32
|
+
if (tab) {
|
|
33
|
+
tab.click();
|
|
34
|
+
await wait(1500);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const items = document.querySelectorAll('[data-e2e="inbox-list"] > div, [data-e2e="inbox-list"] [role="button"]');
|
|
39
|
+
return Array.from(items)
|
|
40
|
+
.filter(el => el.textContent.trim().length > 5)
|
|
41
|
+
.slice(0, limit)
|
|
42
|
+
.map((el, i) => ({
|
|
43
|
+
index: i + 1,
|
|
44
|
+
text: el.textContent.trim().replace(/\\s+/g, ' ').substring(0, 150),
|
|
45
|
+
}));
|
|
46
|
+
})()
|
|
47
|
+
` },
|
|
48
|
+
],
|
|
49
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'tiktok',
|
|
4
|
+
name: 'profile',
|
|
5
|
+
description: 'Get TikTok user profile info',
|
|
6
|
+
domain: 'www.tiktok.com',
|
|
7
|
+
args: [
|
|
8
|
+
{
|
|
9
|
+
name: 'username',
|
|
10
|
+
required: true,
|
|
11
|
+
positional: true,
|
|
12
|
+
help: 'TikTok username (without @)',
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
columns: [
|
|
16
|
+
'username',
|
|
17
|
+
'name',
|
|
18
|
+
'followers',
|
|
19
|
+
'following',
|
|
20
|
+
'likes',
|
|
21
|
+
'videos',
|
|
22
|
+
'verified',
|
|
23
|
+
'bio',
|
|
24
|
+
],
|
|
25
|
+
pipeline: [
|
|
26
|
+
{ navigate: { url: 'https://www.tiktok.com/explore', settleMs: 5000 } },
|
|
27
|
+
{ evaluate: `(async () => {
|
|
28
|
+
const username = \${{ args.username | json }};
|
|
29
|
+
const res = await fetch('https://www.tiktok.com/@' + encodeURIComponent(username), { credentials: 'include' });
|
|
30
|
+
if (!res.ok) throw new Error('User not found: ' + username);
|
|
31
|
+
const html = await res.text();
|
|
32
|
+
const idx = html.indexOf('__UNIVERSAL_DATA_FOR_REHYDRATION__');
|
|
33
|
+
if (idx === -1) throw new Error('Could not parse profile data');
|
|
34
|
+
const start = html.indexOf('>', idx) + 1;
|
|
35
|
+
const end = html.indexOf('</script>', start);
|
|
36
|
+
const data = JSON.parse(html.substring(start, end));
|
|
37
|
+
const ud = data['__DEFAULT_SCOPE__'] && data['__DEFAULT_SCOPE__']['webapp.user-detail'];
|
|
38
|
+
const u = ud && ud.userInfo && ud.userInfo.user;
|
|
39
|
+
const s = ud && ud.userInfo && ud.userInfo.stats;
|
|
40
|
+
if (!u) throw new Error('User not found: ' + username);
|
|
41
|
+
return [{
|
|
42
|
+
username: u.uniqueId || username,
|
|
43
|
+
name: u.nickname || '',
|
|
44
|
+
bio: (u.signature || '').replace(/\\n/g, ' ').substring(0, 120),
|
|
45
|
+
followers: s && s.followerCount || 0,
|
|
46
|
+
following: s && s.followingCount || 0,
|
|
47
|
+
likes: s && s.heartCount || 0,
|
|
48
|
+
videos: s && s.videoCount || 0,
|
|
49
|
+
verified: u.verified ? 'Yes' : 'No',
|
|
50
|
+
}];
|
|
51
|
+
})()
|
|
52
|
+
` },
|
|
53
|
+
],
|
|
54
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'tiktok',
|
|
4
|
+
name: 'save',
|
|
5
|
+
description: 'Add a TikTok video to Favorites',
|
|
6
|
+
domain: 'www.tiktok.com',
|
|
7
|
+
args: [
|
|
8
|
+
{ name: 'url', required: true, positional: true, help: 'TikTok video URL' },
|
|
9
|
+
],
|
|
10
|
+
columns: ['status', 'url'],
|
|
11
|
+
pipeline: [
|
|
12
|
+
{ navigate: { url: '${{ args.url }}', settleMs: 6000 } },
|
|
13
|
+
{ evaluate: `(async () => {
|
|
14
|
+
const url = \${{ args.url | json }};
|
|
15
|
+
const btn = document.querySelector('[data-e2e="bookmark-icon"]') ||
|
|
16
|
+
document.querySelector('[data-e2e="collect-icon"]');
|
|
17
|
+
if (!btn) throw new Error('Favorites button not found - make sure you are logged in');
|
|
18
|
+
const container = btn.closest('button') || btn.closest('[role="button"]') || btn;
|
|
19
|
+
const aria = (container.getAttribute('aria-label') || '').toLowerCase();
|
|
20
|
+
if (aria.includes('remove from favorites') || aria.includes('取消收藏')) {
|
|
21
|
+
return [{ status: 'Already in Favorites', url: url }];
|
|
22
|
+
}
|
|
23
|
+
container.click();
|
|
24
|
+
await new Promise(r => setTimeout(r, 2000));
|
|
25
|
+
return [{ status: 'Added to Favorites', url: url }];
|
|
26
|
+
})()
|
|
27
|
+
` },
|
|
28
|
+
],
|
|
29
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'tiktok',
|
|
4
|
+
name: 'search',
|
|
5
|
+
description: 'Search TikTok videos',
|
|
6
|
+
domain: 'www.tiktok.com',
|
|
7
|
+
args: [
|
|
8
|
+
{ name: 'query', required: true, positional: true, help: 'Search query' },
|
|
9
|
+
{ name: 'limit', type: 'int', default: 10, help: 'Number of results' },
|
|
10
|
+
],
|
|
11
|
+
columns: ['rank', 'desc', 'author', 'url', 'plays', 'likes', 'comments', 'shares'],
|
|
12
|
+
pipeline: [
|
|
13
|
+
{ navigate: { url: 'https://www.tiktok.com/explore', settleMs: 5000 } },
|
|
14
|
+
{ evaluate: `(async () => {
|
|
15
|
+
const query = \${{ args.query | json }};
|
|
16
|
+
const limit = \${{ args.limit }};
|
|
17
|
+
const res = await fetch('/api/search/general/full/?keyword=' + encodeURIComponent(query) + '&offset=0&count=' + limit + '&aid=1988', { credentials: 'include' });
|
|
18
|
+
if (!res.ok) throw new Error('Search failed: HTTP ' + res.status);
|
|
19
|
+
const data = await res.json();
|
|
20
|
+
const items = (data.data || []).filter(function(i) { return i.type === 1 && i.item; });
|
|
21
|
+
return items.slice(0, limit).map(function(i, idx) {
|
|
22
|
+
var v = i.item;
|
|
23
|
+
var a = v.author || {};
|
|
24
|
+
var s = v.stats || {};
|
|
25
|
+
return {
|
|
26
|
+
rank: idx + 1,
|
|
27
|
+
desc: (v.desc || '').replace(/\\n/g, ' ').substring(0, 100),
|
|
28
|
+
author: a.uniqueId || '',
|
|
29
|
+
url: (a.uniqueId && v.id) ? 'https://www.tiktok.com/@' + a.uniqueId + '/video/' + v.id : '',
|
|
30
|
+
plays: s.playCount || 0,
|
|
31
|
+
likes: s.diggCount || 0,
|
|
32
|
+
comments: s.commentCount || 0,
|
|
33
|
+
shares: s.shareCount || 0,
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
})()
|
|
37
|
+
` },
|
|
38
|
+
],
|
|
39
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'tiktok',
|
|
4
|
+
name: 'unfollow',
|
|
5
|
+
description: 'Unfollow a TikTok user',
|
|
6
|
+
domain: 'www.tiktok.com',
|
|
7
|
+
args: [
|
|
8
|
+
{
|
|
9
|
+
name: 'username',
|
|
10
|
+
required: true,
|
|
11
|
+
positional: true,
|
|
12
|
+
help: 'TikTok username (without @)',
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
columns: ['status', 'username'],
|
|
16
|
+
pipeline: [
|
|
17
|
+
{ navigate: { url: 'https://www.tiktok.com/@${{ args.username }}', settleMs: 6000 } },
|
|
18
|
+
{ evaluate: `(async () => {
|
|
19
|
+
const username = \${{ args.username | json }};
|
|
20
|
+
const buttons = Array.from(document.querySelectorAll('button, [role="button"]'));
|
|
21
|
+
const followingBtn = buttons.find(function(b) {
|
|
22
|
+
var text = b.textContent.trim();
|
|
23
|
+
return text === 'Following' || text === '已关注' || text === 'Friends' || text === '互关';
|
|
24
|
+
});
|
|
25
|
+
if (!followingBtn) {
|
|
26
|
+
return [{ status: 'Not following this user', username: username }];
|
|
27
|
+
}
|
|
28
|
+
followingBtn.click();
|
|
29
|
+
await new Promise(r => setTimeout(r, 2000));
|
|
30
|
+
// Confirm unfollow if dialog appears
|
|
31
|
+
var allBtns = Array.from(document.querySelectorAll('button'));
|
|
32
|
+
var confirm = allBtns.find(function(b) {
|
|
33
|
+
var t = b.textContent.trim();
|
|
34
|
+
return t === 'Unfollow' || t === '取消关注';
|
|
35
|
+
});
|
|
36
|
+
if (confirm) {
|
|
37
|
+
confirm.click();
|
|
38
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
39
|
+
}
|
|
40
|
+
return [{ status: 'Unfollowed', username: username }];
|
|
41
|
+
})()
|
|
42
|
+
` },
|
|
43
|
+
],
|
|
44
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'tiktok',
|
|
4
|
+
name: 'unlike',
|
|
5
|
+
description: 'Unlike a TikTok video',
|
|
6
|
+
domain: 'www.tiktok.com',
|
|
7
|
+
args: [
|
|
8
|
+
{ name: 'url', required: true, positional: true, help: 'TikTok video URL' },
|
|
9
|
+
],
|
|
10
|
+
columns: ['status', 'likes', 'url'],
|
|
11
|
+
pipeline: [
|
|
12
|
+
{ navigate: { url: '${{ args.url }}', settleMs: 6000 } },
|
|
13
|
+
{ evaluate: `(async () => {
|
|
14
|
+
const url = \${{ args.url | json }};
|
|
15
|
+
const btn = document.querySelector('[data-e2e="like-icon"]');
|
|
16
|
+
if (!btn) throw new Error('Like button not found - make sure you are logged in');
|
|
17
|
+
const container = btn.closest('button') || btn.closest('[role="button"]') || btn;
|
|
18
|
+
const aria = (container.getAttribute('aria-label') || '').toLowerCase();
|
|
19
|
+
const color = window.getComputedStyle(btn).color;
|
|
20
|
+
const isLiked = aria.includes('unlike') || aria.includes('取消点赞') ||
|
|
21
|
+
(color && (color.includes('255, 65') || color.includes('fe2c55')));
|
|
22
|
+
if (!isLiked) {
|
|
23
|
+
const count = document.querySelector('[data-e2e="like-count"]');
|
|
24
|
+
return [{ status: 'Not liked', likes: count ? count.textContent.trim() : '-', url: url }];
|
|
25
|
+
}
|
|
26
|
+
container.click();
|
|
27
|
+
await new Promise(r => setTimeout(r, 2000));
|
|
28
|
+
const count = document.querySelector('[data-e2e="like-count"]');
|
|
29
|
+
return [{ status: 'Unliked', likes: count ? count.textContent.trim() : '-', url: url }];
|
|
30
|
+
})()
|
|
31
|
+
` },
|
|
32
|
+
],
|
|
33
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'tiktok',
|
|
4
|
+
name: 'unsave',
|
|
5
|
+
description: 'Remove a TikTok video from Favorites',
|
|
6
|
+
domain: 'www.tiktok.com',
|
|
7
|
+
args: [
|
|
8
|
+
{ name: 'url', required: true, positional: true, help: 'TikTok video URL' },
|
|
9
|
+
],
|
|
10
|
+
columns: ['status', 'url'],
|
|
11
|
+
pipeline: [
|
|
12
|
+
{ navigate: { url: '${{ args.url }}', settleMs: 6000 } },
|
|
13
|
+
{ evaluate: `(async () => {
|
|
14
|
+
const url = \${{ args.url | json }};
|
|
15
|
+
const btn = document.querySelector('[data-e2e="bookmark-icon"]') ||
|
|
16
|
+
document.querySelector('[data-e2e="collect-icon"]');
|
|
17
|
+
if (!btn) throw new Error('Favorites button not found - make sure you are logged in');
|
|
18
|
+
const container = btn.closest('button') || btn.closest('[role="button"]') || btn;
|
|
19
|
+
const aria = (container.getAttribute('aria-label') || '').toLowerCase();
|
|
20
|
+
if (aria.includes('add to favorites') || aria.includes('收藏')) {
|
|
21
|
+
if (!aria.includes('remove') && !aria.includes('取消')) {
|
|
22
|
+
return [{ status: 'Not in Favorites', url: url }];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
container.click();
|
|
26
|
+
await new Promise(r => setTimeout(r, 2000));
|
|
27
|
+
return [{ status: 'Removed from Favorites', url: url }];
|
|
28
|
+
})()
|
|
29
|
+
` },
|
|
30
|
+
],
|
|
31
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'tiktok',
|
|
4
|
+
name: 'user',
|
|
5
|
+
description: 'Get recent videos from a TikTok user',
|
|
6
|
+
domain: 'www.tiktok.com',
|
|
7
|
+
args: [
|
|
8
|
+
{
|
|
9
|
+
name: 'username',
|
|
10
|
+
required: true,
|
|
11
|
+
positional: true,
|
|
12
|
+
help: 'TikTok username (without @)',
|
|
13
|
+
},
|
|
14
|
+
{ name: 'limit', type: 'int', default: 10, help: 'Number of videos' },
|
|
15
|
+
],
|
|
16
|
+
columns: ['index', 'views', 'url'],
|
|
17
|
+
pipeline: [
|
|
18
|
+
{ navigate: { url: 'https://www.tiktok.com/@${{ args.username }}', settleMs: 6000 } },
|
|
19
|
+
{ evaluate: `(() => {
|
|
20
|
+
const limit = \${{ args.limit }};
|
|
21
|
+
const username = \${{ args.username | json }};
|
|
22
|
+
const links = Array.from(document.querySelectorAll('a[href*="/video/"]'));
|
|
23
|
+
const seen = {};
|
|
24
|
+
const results = [];
|
|
25
|
+
for (const a of links) {
|
|
26
|
+
const href = a.href;
|
|
27
|
+
if (seen[href]) continue;
|
|
28
|
+
seen[href] = true;
|
|
29
|
+
results.push({
|
|
30
|
+
index: results.length + 1,
|
|
31
|
+
views: a.textContent.trim() || '-',
|
|
32
|
+
url: href,
|
|
33
|
+
});
|
|
34
|
+
if (results.length >= limit) break;
|
|
35
|
+
}
|
|
36
|
+
if (results.length === 0) throw new Error('No videos found for @' + username);
|
|
37
|
+
return results;
|
|
38
|
+
})()
|
|
39
|
+
` },
|
|
40
|
+
],
|
|
41
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'v2ex',
|
|
4
|
+
name: 'hot',
|
|
5
|
+
description: 'V2EX 热门话题',
|
|
6
|
+
domain: 'www.v2ex.com',
|
|
7
|
+
strategy: Strategy.PUBLIC,
|
|
8
|
+
browser: false,
|
|
9
|
+
args: [
|
|
10
|
+
{ name: 'limit', type: 'int', default: 20, help: 'Number of topics' },
|
|
11
|
+
],
|
|
12
|
+
columns: ['id', 'rank', 'title', 'node', 'replies', 'url'],
|
|
13
|
+
pipeline: [
|
|
14
|
+
{ fetch: { url: 'https://www.v2ex.com/api/topics/hot.json' } },
|
|
15
|
+
{ map: {
|
|
16
|
+
id: '${{ item.id }}',
|
|
17
|
+
rank: '${{ index + 1 }}',
|
|
18
|
+
title: '${{ item.title }}',
|
|
19
|
+
node: '${{ item.node.title }}',
|
|
20
|
+
replies: '${{ item.replies }}',
|
|
21
|
+
url: '${{ item.url }}',
|
|
22
|
+
} },
|
|
23
|
+
{ limit: '${{ args.limit }}' },
|
|
24
|
+
],
|
|
25
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'v2ex',
|
|
4
|
+
name: 'latest',
|
|
5
|
+
description: 'V2EX 最新话题',
|
|
6
|
+
domain: 'www.v2ex.com',
|
|
7
|
+
strategy: Strategy.PUBLIC,
|
|
8
|
+
browser: false,
|
|
9
|
+
args: [
|
|
10
|
+
{ name: 'limit', type: 'int', default: 20, help: 'Number of topics' },
|
|
11
|
+
],
|
|
12
|
+
columns: ['id', 'rank', 'title', 'node', 'replies', 'url'],
|
|
13
|
+
pipeline: [
|
|
14
|
+
{ fetch: { url: 'https://www.v2ex.com/api/topics/latest.json' } },
|
|
15
|
+
{ map: {
|
|
16
|
+
id: '${{ item.id }}',
|
|
17
|
+
rank: '${{ index + 1 }}',
|
|
18
|
+
title: '${{ item.title }}',
|
|
19
|
+
node: '${{ item.node.title }}',
|
|
20
|
+
replies: '${{ item.replies }}',
|
|
21
|
+
url: '${{ item.url }}',
|
|
22
|
+
} },
|
|
23
|
+
{ limit: '${{ args.limit }}' },
|
|
24
|
+
],
|
|
25
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|