@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,118 @@
|
|
|
1
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'douban',
|
|
4
|
+
name: 'subject',
|
|
5
|
+
description: '获取电影详情',
|
|
6
|
+
domain: 'movie.douban.com',
|
|
7
|
+
strategy: Strategy.COOKIE,
|
|
8
|
+
browser: true,
|
|
9
|
+
args: [
|
|
10
|
+
{ name: 'id', required: true, positional: true, help: '电影 ID' },
|
|
11
|
+
],
|
|
12
|
+
columns: [
|
|
13
|
+
'id',
|
|
14
|
+
'title',
|
|
15
|
+
'originalTitle',
|
|
16
|
+
'year',
|
|
17
|
+
'rating',
|
|
18
|
+
'ratingCount',
|
|
19
|
+
'genres',
|
|
20
|
+
'directors',
|
|
21
|
+
'casts',
|
|
22
|
+
'country',
|
|
23
|
+
'duration',
|
|
24
|
+
'summary',
|
|
25
|
+
'url',
|
|
26
|
+
],
|
|
27
|
+
pipeline: [
|
|
28
|
+
{ navigate: 'https://movie.douban.com/subject/${{ args.id }}' },
|
|
29
|
+
{ evaluate: `(async () => {
|
|
30
|
+
const id = '\${{ args.id }}';
|
|
31
|
+
|
|
32
|
+
// Wait for page to load
|
|
33
|
+
await new Promise(r => setTimeout(r, 2000));
|
|
34
|
+
|
|
35
|
+
// Extract title - v:itemreviewed contains "中文名 OriginalName"
|
|
36
|
+
const titleEl = document.querySelector('span[property="v:itemreviewed"]');
|
|
37
|
+
const fullTitle = titleEl?.textContent?.trim() || '';
|
|
38
|
+
|
|
39
|
+
// Split title and originalTitle
|
|
40
|
+
// Douban format: "中文名 OriginalName" - split by first space that separates CJK from non-CJK
|
|
41
|
+
let title = fullTitle;
|
|
42
|
+
let originalTitle = '';
|
|
43
|
+
const titleMatch = fullTitle.match(/^([\\u4e00-\\u9fff\\u3000-\\u303f\\uff00-\\uffef]+(?:\\s*[\\u4e00-\\u9fff\\u3000-\\u303f\\uff00-\\uffef·::!?]+)*)\\s+(.+)$/);
|
|
44
|
+
if (titleMatch) {
|
|
45
|
+
title = titleMatch[1].trim();
|
|
46
|
+
originalTitle = titleMatch[2].trim();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Extract year
|
|
50
|
+
const yearEl = document.querySelector('.year');
|
|
51
|
+
const year = yearEl?.textContent?.trim().replace(/[()()]/g, '') || '';
|
|
52
|
+
|
|
53
|
+
// Extract rating
|
|
54
|
+
const ratingEl = document.querySelector('strong[property="v:average"]');
|
|
55
|
+
const rating = parseFloat(ratingEl?.textContent || '0');
|
|
56
|
+
|
|
57
|
+
// Extract rating count
|
|
58
|
+
const ratingCountEl = document.querySelector('span[property="v:votes"]');
|
|
59
|
+
const ratingCount = parseInt(ratingCountEl?.textContent || '0', 10);
|
|
60
|
+
|
|
61
|
+
// Extract genres
|
|
62
|
+
const genreEls = document.querySelectorAll('span[property="v:genre"]');
|
|
63
|
+
const genres = Array.from(genreEls).map(el => el.textContent?.trim()).filter(Boolean).join(',');
|
|
64
|
+
|
|
65
|
+
// Extract directors
|
|
66
|
+
const directorEls = document.querySelectorAll('a[rel="v:directedBy"]');
|
|
67
|
+
const directors = Array.from(directorEls).map(el => el.textContent?.trim()).filter(Boolean).join(',');
|
|
68
|
+
|
|
69
|
+
// Extract casts
|
|
70
|
+
const castEls = document.querySelectorAll('a[rel="v:starring"]');
|
|
71
|
+
const casts = Array.from(castEls).slice(0, 5).map(el => el.textContent?.trim()).filter(Boolean);
|
|
72
|
+
|
|
73
|
+
// Extract info section for country and duration
|
|
74
|
+
const infoEl = document.querySelector('#info');
|
|
75
|
+
const infoText = infoEl?.textContent || '';
|
|
76
|
+
|
|
77
|
+
// Extract country/region from #info as list
|
|
78
|
+
let country = [];
|
|
79
|
+
const countryMatch = infoText.match(/制片国家\\/地区:\\s*([^\\n]+)/);
|
|
80
|
+
if (countryMatch) {
|
|
81
|
+
country = countryMatch[1].trim().split(/\\s*\\/\\s*/).filter(Boolean);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Extract duration from #info as pure number in min
|
|
85
|
+
const durationEl = document.querySelector('span[property="v:runtime"]');
|
|
86
|
+
let durationRaw = durationEl?.textContent?.trim() || '';
|
|
87
|
+
if (!durationRaw) {
|
|
88
|
+
const durationMatch = infoText.match(/片长:\\s*([^\\n]+)/);
|
|
89
|
+
if (durationMatch) {
|
|
90
|
+
durationRaw = durationMatch[1].trim();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const durationNumMatch = durationRaw.match(/(\\d+)/);
|
|
94
|
+
const duration = durationNumMatch ? parseInt(durationNumMatch[1], 10) : null;
|
|
95
|
+
|
|
96
|
+
// Extract summary
|
|
97
|
+
const summaryEl = document.querySelector('span[property="v:summary"]');
|
|
98
|
+
const summary = summaryEl?.textContent?.trim() || '';
|
|
99
|
+
|
|
100
|
+
return [{
|
|
101
|
+
id,
|
|
102
|
+
title,
|
|
103
|
+
originalTitle,
|
|
104
|
+
year,
|
|
105
|
+
rating,
|
|
106
|
+
ratingCount,
|
|
107
|
+
genres,
|
|
108
|
+
directors,
|
|
109
|
+
casts,
|
|
110
|
+
country,
|
|
111
|
+
duration,
|
|
112
|
+
summary: summary.substring(0, 200),
|
|
113
|
+
url: \`https://movie.douban.com/subject/\${id}\`
|
|
114
|
+
}];
|
|
115
|
+
})()
|
|
116
|
+
` },
|
|
117
|
+
],
|
|
118
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'douban',
|
|
4
|
+
name: 'top250',
|
|
5
|
+
description: '豆瓣电影 Top250',
|
|
6
|
+
domain: 'movie.douban.com',
|
|
7
|
+
strategy: Strategy.COOKIE,
|
|
8
|
+
browser: true,
|
|
9
|
+
args: [
|
|
10
|
+
{ name: 'limit', type: 'int', default: 250, help: '返回结果数量' },
|
|
11
|
+
],
|
|
12
|
+
columns: ['rank', 'id', 'title', 'rating', 'url'],
|
|
13
|
+
pipeline: [
|
|
14
|
+
{ navigate: 'https://movie.douban.com/top250' },
|
|
15
|
+
{ evaluate: `async () => {
|
|
16
|
+
const results = [];
|
|
17
|
+
const limit = \${{ args.limit }};
|
|
18
|
+
|
|
19
|
+
const parsePage = (doc) => {
|
|
20
|
+
const items = doc.querySelectorAll('.item');
|
|
21
|
+
for (const item of items) {
|
|
22
|
+
if (results.length >= limit) break;
|
|
23
|
+
|
|
24
|
+
const rankEl = item.querySelector('.pic em');
|
|
25
|
+
const linkEl = item.querySelector('a');
|
|
26
|
+
const titleEl = item.querySelector('.title');
|
|
27
|
+
const ratingEl = item.querySelector('.rating_num');
|
|
28
|
+
|
|
29
|
+
const href = linkEl?.href || '';
|
|
30
|
+
const matchResult = href.match(/subject\\/(\\d+)/);
|
|
31
|
+
const id = matchResult ? matchResult[1] : '';
|
|
32
|
+
|
|
33
|
+
const title = titleEl?.textContent?.trim() || '';
|
|
34
|
+
const rank = parseInt(rankEl?.textContent || '0', 10);
|
|
35
|
+
const rating = ratingEl?.textContent?.trim() || '';
|
|
36
|
+
|
|
37
|
+
if (id && title) {
|
|
38
|
+
results.push({
|
|
39
|
+
rank: rank || results.length + 1,
|
|
40
|
+
id,
|
|
41
|
+
title,
|
|
42
|
+
rating: rating ? parseFloat(rating) : 0,
|
|
43
|
+
url: href
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
parsePage(document);
|
|
50
|
+
|
|
51
|
+
for (let start = 25; start < 250 && results.length < limit; start += 25) {
|
|
52
|
+
const resp = await fetch(\`https://movie.douban.com/top250?start=\${start}\`);
|
|
53
|
+
if (!resp.ok) break;
|
|
54
|
+
const html = await resp.text();
|
|
55
|
+
if (!html) break;
|
|
56
|
+
|
|
57
|
+
const doc = new DOMParser().parseFromString(html, 'text/html');
|
|
58
|
+
parsePage(doc);
|
|
59
|
+
await new Promise(r => setTimeout(r, 150));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return results;
|
|
63
|
+
}
|
|
64
|
+
` },
|
|
65
|
+
{ limit: '${{ args.limit }}' },
|
|
66
|
+
],
|
|
67
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'facebook',
|
|
4
|
+
name: 'add-friend',
|
|
5
|
+
description: 'Send a friend request on Facebook',
|
|
6
|
+
domain: 'www.facebook.com',
|
|
7
|
+
args: [
|
|
8
|
+
{
|
|
9
|
+
name: 'username',
|
|
10
|
+
required: true,
|
|
11
|
+
positional: true,
|
|
12
|
+
help: 'Facebook username or profile URL',
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
columns: ['status', 'username'],
|
|
16
|
+
pipeline: [
|
|
17
|
+
{ navigate: { url: 'https://www.facebook.com/${{ args.username }}', settleMs: 3000 } },
|
|
18
|
+
{ evaluate: `(async () => {
|
|
19
|
+
const username = \${{ args.username | json }};
|
|
20
|
+
// Find "Add Friend" button
|
|
21
|
+
const buttons = Array.from(document.querySelectorAll('[role="button"]'));
|
|
22
|
+
const addBtn = buttons.find(b => {
|
|
23
|
+
const text = b.textContent.trim();
|
|
24
|
+
return text === '加好友' || text === 'Add Friend' || text === 'Add friend';
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
if (!addBtn) {
|
|
28
|
+
// Check if already friends
|
|
29
|
+
const isFriend = buttons.some(b => {
|
|
30
|
+
const t = b.textContent.trim();
|
|
31
|
+
return t === '好友' || t === 'Friends' || t.includes('已发送') || t.includes('Pending');
|
|
32
|
+
});
|
|
33
|
+
if (isFriend) return [{ status: 'Already friends or request pending', username }];
|
|
34
|
+
return [{ status: 'Add Friend button not found', username }];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
addBtn.click();
|
|
38
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
39
|
+
return [{ status: 'Friend request sent', username }];
|
|
40
|
+
})()
|
|
41
|
+
` },
|
|
42
|
+
],
|
|
43
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'facebook',
|
|
4
|
+
name: 'events',
|
|
5
|
+
description: 'Browse Facebook event categories',
|
|
6
|
+
domain: 'www.facebook.com',
|
|
7
|
+
args: [
|
|
8
|
+
{ name: 'limit', type: 'int', default: 15, help: 'Number of categories' },
|
|
9
|
+
],
|
|
10
|
+
columns: ['index', 'name'],
|
|
11
|
+
pipeline: [
|
|
12
|
+
{ navigate: { url: 'https://www.facebook.com/events', settleMs: 3000 } },
|
|
13
|
+
{ evaluate: `(() => {
|
|
14
|
+
const limit = \${{ args.limit }};
|
|
15
|
+
// Try actual event items first
|
|
16
|
+
const articles = document.querySelectorAll('[role="article"]');
|
|
17
|
+
if (articles.length > 0) {
|
|
18
|
+
return Array.from(articles).slice(0, limit).map((el, i) => ({
|
|
19
|
+
index: i + 1,
|
|
20
|
+
name: el.textContent.trim().replace(/\\s+/g, ' ').substring(0, 120),
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// List event categories from sidebar navigation
|
|
25
|
+
const links = Array.from(document.querySelectorAll('[role="navigation"] a'))
|
|
26
|
+
.filter(a => {
|
|
27
|
+
const href = a.href || '';
|
|
28
|
+
const text = a.textContent.trim();
|
|
29
|
+
return href.includes('/events/') && text.length > 1 && text.length < 60 &&
|
|
30
|
+
!href.includes('create');
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
return links.slice(0, limit).map((a, i) => ({
|
|
34
|
+
index: i + 1,
|
|
35
|
+
name: a.textContent.trim(),
|
|
36
|
+
}));
|
|
37
|
+
})()
|
|
38
|
+
` },
|
|
39
|
+
],
|
|
40
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'facebook',
|
|
4
|
+
name: 'feed',
|
|
5
|
+
description: 'Get your Facebook news feed',
|
|
6
|
+
domain: 'www.facebook.com',
|
|
7
|
+
args: [
|
|
8
|
+
{ name: 'limit', type: 'int', default: 10, help: 'Number of posts' },
|
|
9
|
+
],
|
|
10
|
+
columns: ['index', 'author', 'content', 'likes', 'comments', 'shares'],
|
|
11
|
+
pipeline: [
|
|
12
|
+
{ navigate: { url: 'https://www.facebook.com/', settleMs: 4000 } },
|
|
13
|
+
{ evaluate: `(() => {
|
|
14
|
+
const limit = \${{ args.limit }};
|
|
15
|
+
const posts = document.querySelectorAll('[role="article"]');
|
|
16
|
+
return Array.from(posts)
|
|
17
|
+
.filter(el => {
|
|
18
|
+
const text = el.textContent.trim();
|
|
19
|
+
// Filter out "People you may know" suggestions (both CN and EN)
|
|
20
|
+
return text.length > 30 &&
|
|
21
|
+
!text.startsWith('可能认识') &&
|
|
22
|
+
!text.startsWith('People you may know') &&
|
|
23
|
+
!text.startsWith('People You May Know');
|
|
24
|
+
})
|
|
25
|
+
.slice(0, limit)
|
|
26
|
+
.map((el, i) => {
|
|
27
|
+
// Author from header link
|
|
28
|
+
const headerLink = el.querySelector('h2 a, h3 a, h4 a, strong a');
|
|
29
|
+
const author = headerLink ? headerLink.textContent.trim() : '';
|
|
30
|
+
|
|
31
|
+
// Post text: grab visible spans, filter noise
|
|
32
|
+
const spans = Array.from(el.querySelectorAll('div[dir="auto"]'))
|
|
33
|
+
.map(s => s.textContent.trim())
|
|
34
|
+
.filter(t => t.length > 10 && t.length < 500);
|
|
35
|
+
const content = spans.length > 0 ? spans[0] : '';
|
|
36
|
+
|
|
37
|
+
// Engagement: find like/comment/share counts (CN + EN)
|
|
38
|
+
const allText = el.textContent;
|
|
39
|
+
const likesMatch = allText.match(/所有心情:([\\d,.\\s]*[\\d万亿KMk]+)/) ||
|
|
40
|
+
allText.match(/All:\\s*([\\d,.KMk]+)/) ||
|
|
41
|
+
allText.match(/([\\d,.KMk]+)\\s*(?:likes?|reactions?)/i);
|
|
42
|
+
const commentsMatch = allText.match(/([\\d,.]+\\s*[万亿]?)\\s*条评论/) ||
|
|
43
|
+
allText.match(/([\\d,.KMk]+)\\s*comments?/i);
|
|
44
|
+
const sharesMatch = allText.match(/([\\d,.]+\\s*[万亿]?)\\s*次分享/) ||
|
|
45
|
+
allText.match(/([\\d,.KMk]+)\\s*shares?/i);
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
index: i + 1,
|
|
49
|
+
author: author.substring(0, 50),
|
|
50
|
+
content: content.replace(/\\n/g, ' ').substring(0, 120),
|
|
51
|
+
likes: likesMatch ? likesMatch[1] : '-',
|
|
52
|
+
comments: commentsMatch ? commentsMatch[1] : '-',
|
|
53
|
+
shares: sharesMatch ? sharesMatch[1] : '-',
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
})()
|
|
57
|
+
` },
|
|
58
|
+
],
|
|
59
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'facebook',
|
|
4
|
+
name: 'friends',
|
|
5
|
+
description: 'Get Facebook friend suggestions',
|
|
6
|
+
domain: 'www.facebook.com',
|
|
7
|
+
args: [
|
|
8
|
+
{ name: 'limit', type: 'int', default: 10, help: 'Number of friend suggestions' },
|
|
9
|
+
],
|
|
10
|
+
columns: ['index', 'name', 'mutual'],
|
|
11
|
+
pipeline: [
|
|
12
|
+
{ navigate: { url: 'https://www.facebook.com/friends', settleMs: 3000 } },
|
|
13
|
+
{ evaluate: `(() => {
|
|
14
|
+
const limit = \${{ args.limit }};
|
|
15
|
+
const items = document.querySelectorAll('[role="listitem"]');
|
|
16
|
+
return Array.from(items)
|
|
17
|
+
.slice(0, limit)
|
|
18
|
+
.map((el, i) => {
|
|
19
|
+
const text = el.textContent.trim().replace(/\\s+/g, ' ');
|
|
20
|
+
// Extract mutual info if present (before name extraction to avoid pollution)
|
|
21
|
+
const mutualMatch = text.match(/([\\d,]+)\\s*位.*(?:关注|共同|mutual)/);
|
|
22
|
+
// Extract name: remove mutual info, action buttons, etc.
|
|
23
|
+
let name = text
|
|
24
|
+
.replace(/[\\d,]+\\s*位.*(?:关注了|共同好友|mutual friends?)/, '')
|
|
25
|
+
.replace(/加好友.*/, '').replace(/Add [Ff]riend.*/, '')
|
|
26
|
+
.replace(/移除$/, '').replace(/Remove$/, '')
|
|
27
|
+
.trim();
|
|
28
|
+
return {
|
|
29
|
+
index: i + 1,
|
|
30
|
+
name: name.substring(0, 50),
|
|
31
|
+
mutual: mutualMatch ? mutualMatch[1] : '-',
|
|
32
|
+
};
|
|
33
|
+
})
|
|
34
|
+
.filter(item => item.name.length > 0);
|
|
35
|
+
})()
|
|
36
|
+
` },
|
|
37
|
+
],
|
|
38
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'facebook',
|
|
4
|
+
name: 'groups',
|
|
5
|
+
description: 'List your Facebook groups',
|
|
6
|
+
domain: 'www.facebook.com',
|
|
7
|
+
args: [
|
|
8
|
+
{ name: 'limit', type: 'int', default: 20, help: 'Number of groups' },
|
|
9
|
+
],
|
|
10
|
+
columns: ['index', 'name', 'last_post', 'url'],
|
|
11
|
+
pipeline: [
|
|
12
|
+
{ navigate: { url: 'https://www.facebook.com/groups/feed/', settleMs: 3000 } },
|
|
13
|
+
{ evaluate: `(() => {
|
|
14
|
+
const limit = \${{ args.limit }};
|
|
15
|
+
const links = Array.from(document.querySelectorAll('a'))
|
|
16
|
+
.filter(a => {
|
|
17
|
+
const href = a.href || '';
|
|
18
|
+
return href.includes('/groups/') &&
|
|
19
|
+
!href.includes('/feed') &&
|
|
20
|
+
!href.includes('/discover') &&
|
|
21
|
+
!href.includes('/joins') &&
|
|
22
|
+
!href.includes('category=create') &&
|
|
23
|
+
a.textContent.trim().length > 2;
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// Deduplicate by href
|
|
27
|
+
const seen = new Set();
|
|
28
|
+
const groups = [];
|
|
29
|
+
for (const a of links) {
|
|
30
|
+
const href = a.href.split('?')[0];
|
|
31
|
+
if (seen.has(href)) continue;
|
|
32
|
+
seen.add(href);
|
|
33
|
+
const raw = a.textContent.trim().replace(/\\s+/g, ' ');
|
|
34
|
+
// Split name from "上次发帖" info
|
|
35
|
+
const parts = raw.split(/上次发帖|Last post/);
|
|
36
|
+
groups.push({
|
|
37
|
+
name: (parts[0] || '').trim().substring(0, 60),
|
|
38
|
+
last_post: parts[1] ? parts[1].replace(/^[::]/, '').trim() : '-',
|
|
39
|
+
url: href,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return groups.slice(0, limit).map((g, i) => ({ index: i + 1, ...g }));
|
|
43
|
+
})()
|
|
44
|
+
` },
|
|
45
|
+
],
|
|
46
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'facebook',
|
|
4
|
+
name: 'join-group',
|
|
5
|
+
description: 'Join a Facebook group',
|
|
6
|
+
domain: 'www.facebook.com',
|
|
7
|
+
args: [
|
|
8
|
+
{
|
|
9
|
+
name: 'group',
|
|
10
|
+
required: true,
|
|
11
|
+
positional: true,
|
|
12
|
+
help: `Group ID or URL path (e.g. '1876150192925481' or group name)`,
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
columns: ['status', 'group'],
|
|
16
|
+
pipeline: [
|
|
17
|
+
{ navigate: { url: 'https://www.facebook.com/groups/${{ args.group }}', settleMs: 3000 } },
|
|
18
|
+
{ evaluate: `(async () => {
|
|
19
|
+
const group = \${{ args.group | json }};
|
|
20
|
+
const groupName = document.querySelector('h1')?.textContent?.trim() || group;
|
|
21
|
+
|
|
22
|
+
// Find "Join Group" button
|
|
23
|
+
const buttons = Array.from(document.querySelectorAll('[role="button"]'));
|
|
24
|
+
const joinBtn = buttons.find(b => {
|
|
25
|
+
const text = b.textContent.trim();
|
|
26
|
+
return text === '加入小组' || text === 'Join group' || text === 'Join Group';
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
if (!joinBtn) {
|
|
30
|
+
const isMember = buttons.some(b => {
|
|
31
|
+
const t = b.textContent.trim();
|
|
32
|
+
return t === '已加入' || t === 'Joined' || t === '成员' || t === 'Member';
|
|
33
|
+
});
|
|
34
|
+
if (isMember) return [{ status: 'Already a member', group: groupName }];
|
|
35
|
+
return [{ status: 'Join button not found', group: groupName }];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
joinBtn.click();
|
|
39
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
40
|
+
return [{ status: 'Join request sent', group: groupName }];
|
|
41
|
+
})()
|
|
42
|
+
` },
|
|
43
|
+
],
|
|
44
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'facebook',
|
|
4
|
+
name: 'memories',
|
|
5
|
+
description: 'Get your Facebook memories (On This Day)',
|
|
6
|
+
domain: 'www.facebook.com',
|
|
7
|
+
args: [
|
|
8
|
+
{ name: 'limit', type: 'int', default: 10, help: 'Number of memories' },
|
|
9
|
+
],
|
|
10
|
+
columns: ['index', 'source', 'content', 'time'],
|
|
11
|
+
pipeline: [
|
|
12
|
+
{ navigate: { url: 'https://www.facebook.com/onthisday', settleMs: 4000 } },
|
|
13
|
+
{ evaluate: `(() => {
|
|
14
|
+
const limit = \${{ args.limit }};
|
|
15
|
+
const articles = document.querySelectorAll('[role="article"]');
|
|
16
|
+
return Array.from(articles)
|
|
17
|
+
.slice(0, limit)
|
|
18
|
+
.map((el, i) => {
|
|
19
|
+
const headerLink = el.querySelector('h2 a, h3 a, h4 a, strong a');
|
|
20
|
+
const spans = Array.from(el.querySelectorAll('div[dir="auto"]'))
|
|
21
|
+
.map(s => s.textContent.trim())
|
|
22
|
+
.filter(t => t.length > 5 && t.length < 500);
|
|
23
|
+
const timeEl = el.querySelector('a[href*="/posts/"] span, a[href*="story_fbid"] span');
|
|
24
|
+
return {
|
|
25
|
+
index: i + 1,
|
|
26
|
+
source: headerLink ? headerLink.textContent.trim().substring(0, 50) : '-',
|
|
27
|
+
content: (spans[0] || '').replace(/\\n/g, ' ').substring(0, 150),
|
|
28
|
+
time: timeEl ? timeEl.textContent.trim() : '-',
|
|
29
|
+
};
|
|
30
|
+
})
|
|
31
|
+
.filter(item => item.content.length > 0 || item.source !== '-');
|
|
32
|
+
})()
|
|
33
|
+
` },
|
|
34
|
+
],
|
|
35
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'facebook',
|
|
4
|
+
name: 'notifications',
|
|
5
|
+
description: 'Get recent Facebook notifications',
|
|
6
|
+
domain: 'www.facebook.com',
|
|
7
|
+
args: [
|
|
8
|
+
{ name: 'limit', type: 'int', default: 15, help: 'Number of notifications' },
|
|
9
|
+
],
|
|
10
|
+
columns: ['index', 'text', 'time'],
|
|
11
|
+
pipeline: [
|
|
12
|
+
{ navigate: { url: 'https://www.facebook.com/notifications', settleMs: 3000 } },
|
|
13
|
+
{ evaluate: `(() => {
|
|
14
|
+
const limit = \${{ args.limit }};
|
|
15
|
+
const items = document.querySelectorAll('[role="listitem"]');
|
|
16
|
+
return Array.from(items)
|
|
17
|
+
.filter(el => el.querySelectorAll('a').length > 0)
|
|
18
|
+
.slice(0, limit)
|
|
19
|
+
.map((el, i) => {
|
|
20
|
+
const raw = el.textContent.trim().replace(/\\s+/g, ' ');
|
|
21
|
+
// Remove leading "未读" and trailing "标记为已读"
|
|
22
|
+
const cleaned = raw.replace(/^未读/, '').replace(/标记为已读$/, '').replace(/^Unread/, '').replace(/Mark as read$/, '').trim();
|
|
23
|
+
// Try to extract time (last segment like "11小时", "5天", "1周")
|
|
24
|
+
const timeMatch = cleaned.match(/(\\d+\\s*(?:分钟|小时|天|周|个月|minutes?|hours?|days?|weeks?|months?))\\s*$/);
|
|
25
|
+
const time = timeMatch ? timeMatch[1] : '';
|
|
26
|
+
const text = timeMatch ? cleaned.slice(0, -timeMatch[0].length).trim() : cleaned;
|
|
27
|
+
return {
|
|
28
|
+
index: i + 1,
|
|
29
|
+
text: text.substring(0, 150),
|
|
30
|
+
time: time || '-',
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
})()
|
|
34
|
+
` },
|
|
35
|
+
],
|
|
36
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'facebook',
|
|
4
|
+
name: 'profile',
|
|
5
|
+
description: 'Get Facebook user/page profile info',
|
|
6
|
+
domain: 'www.facebook.com',
|
|
7
|
+
args: [
|
|
8
|
+
{
|
|
9
|
+
name: 'username',
|
|
10
|
+
required: true,
|
|
11
|
+
positional: true,
|
|
12
|
+
help: 'Facebook username or page name',
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
columns: ['name', 'username', 'friends', 'followers', 'url'],
|
|
16
|
+
pipeline: [
|
|
17
|
+
{ navigate: { url: 'https://www.facebook.com/${{ args.username }}', settleMs: 3000 } },
|
|
18
|
+
{ evaluate: `(() => {
|
|
19
|
+
const h1 = document.querySelector('h1');
|
|
20
|
+
let name = h1 ? h1.textContent.trim() : '';
|
|
21
|
+
|
|
22
|
+
// Find friends/followers links
|
|
23
|
+
const links = Array.from(document.querySelectorAll('a'));
|
|
24
|
+
const friendsLink = links.find(a => a.href && a.href.includes('/friends'));
|
|
25
|
+
const followersLink = links.find(a => a.href && a.href.includes('/followers'));
|
|
26
|
+
|
|
27
|
+
return [{
|
|
28
|
+
name: name,
|
|
29
|
+
username: \${{ args.username | json }},
|
|
30
|
+
friends: friendsLink ? friendsLink.textContent.trim() : '-',
|
|
31
|
+
followers: followersLink ? followersLink.textContent.trim() : '-',
|
|
32
|
+
url: window.location.href,
|
|
33
|
+
}];
|
|
34
|
+
})()
|
|
35
|
+
` },
|
|
36
|
+
],
|
|
37
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cli } from '@jackwener/opencli/registry';
|
|
2
|
+
cli({
|
|
3
|
+
site: 'facebook',
|
|
4
|
+
name: 'search',
|
|
5
|
+
description: 'Search Facebook for people, pages, or posts',
|
|
6
|
+
domain: 'www.facebook.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: ['index', 'title', 'text', 'url'],
|
|
12
|
+
pipeline: [
|
|
13
|
+
{ navigate: 'https://www.facebook.com' },
|
|
14
|
+
{ navigate: { url: 'https://www.facebook.com/search/top?q=${{ args.query | urlencode }}', settleMs: 4000 } },
|
|
15
|
+
{ evaluate: `(async () => {
|
|
16
|
+
const limit = \${{ args.limit }};
|
|
17
|
+
// Search results are typically in role="article" or role="listitem"
|
|
18
|
+
let items = document.querySelectorAll('[role="article"]');
|
|
19
|
+
if (items.length === 0) {
|
|
20
|
+
items = document.querySelectorAll('[role="listitem"]');
|
|
21
|
+
}
|
|
22
|
+
return Array.from(items)
|
|
23
|
+
.filter(el => el.textContent.trim().length > 20)
|
|
24
|
+
.slice(0, limit)
|
|
25
|
+
.map((el, i) => {
|
|
26
|
+
const link = el.querySelector('a[href*="facebook.com/"]');
|
|
27
|
+
const heading = el.querySelector('h2, h3, h4, strong');
|
|
28
|
+
return {
|
|
29
|
+
index: i + 1,
|
|
30
|
+
title: heading ? heading.textContent.trim().substring(0, 80) : '',
|
|
31
|
+
text: el.textContent.trim().replace(/\\s+/g, ' ').substring(0, 150),
|
|
32
|
+
url: link ? link.href.split('?')[0] : '',
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
})()
|
|
36
|
+
` },
|
|
37
|
+
],
|
|
38
|
+
});
|