@zenalexa/unicli 0.209.0 → 0.210.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/AGENTS.md +56 -15
- package/README.md +228 -278
- package/dist/adapters/cursor/cursor.d.ts +2 -1
- package/dist/adapters/cursor/cursor.d.ts.map +1 -1
- package/dist/adapters/cursor/cursor.js +87 -1
- package/dist/adapters/cursor/cursor.js.map +1 -1
- package/dist/adapters/discord-app/discord-app.d.ts +1 -1
- package/dist/adapters/discord-app/discord-app.js +94 -1
- package/dist/adapters/discord-app/discord-app.js.map +1 -1
- package/dist/browser/bridge.d.ts +45 -0
- package/dist/browser/bridge.d.ts.map +1 -1
- package/dist/browser/bridge.js +94 -1
- package/dist/browser/bridge.js.map +1 -1
- package/dist/browser/cdp-client.d.ts +24 -1
- package/dist/browser/cdp-client.d.ts.map +1 -1
- package/dist/browser/cdp-client.js +56 -2
- package/dist/browser/cdp-client.js.map +1 -1
- package/dist/browser/launcher.d.ts +5 -0
- package/dist/browser/launcher.d.ts.map +1 -1
- package/dist/browser/launcher.js +7 -0
- package/dist/browser/launcher.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +67 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/browser.d.ts.map +1 -1
- package/dist/commands/browser.js +79 -1
- package/dist/commands/browser.js.map +1 -1
- package/dist/commands/ext.d.ts +11 -0
- package/dist/commands/ext.d.ts.map +1 -0
- package/dist/commands/ext.js +122 -0
- package/dist/commands/ext.js.map +1 -0
- package/dist/commands/skills.d.ts +2 -3
- package/dist/commands/skills.d.ts.map +1 -1
- package/dist/commands/skills.js +2 -3
- package/dist/commands/skills.js.map +1 -1
- package/dist/commands/status.d.ts +12 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +137 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/engine/yaml-runner.d.ts +10 -0
- package/dist/engine/yaml-runner.d.ts.map +1 -1
- package/dist/engine/yaml-runner.js +51 -3
- package/dist/engine/yaml-runner.js.map +1 -1
- package/dist/hub/index.d.ts +37 -0
- package/dist/hub/index.d.ts.map +1 -0
- package/dist/hub/index.js +98 -0
- package/dist/hub/index.js.map +1 -0
- package/dist/hub/passthrough.d.ts +21 -0
- package/dist/hub/passthrough.d.ts.map +1 -0
- package/dist/hub/passthrough.js +71 -0
- package/dist/hub/passthrough.js.map +1 -0
- package/dist/manifest.json +1770 -64
- package/dist/types.d.ts +15 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -1
- package/src/adapters/36kr/latest.yaml +36 -0
- package/src/adapters/arxiv/trending.yaml +37 -0
- package/src/adapters/baidu/hot.yaml +37 -0
- package/src/adapters/baidu/search.yaml +41 -0
- package/src/adapters/bbc/technology.yaml +26 -0
- package/src/adapters/bbc/top.yaml +26 -0
- package/src/adapters/bbc/world.yaml +26 -0
- package/src/adapters/bilibili/coin.yaml +33 -0
- package/src/adapters/bilibili/later.yaml +31 -0
- package/src/adapters/bilibili/live.yaml +41 -0
- package/src/adapters/bilibili/trending.yaml +29 -0
- package/src/adapters/binance/hot.yaml +39 -0
- package/src/adapters/binance/kline.yaml +35 -0
- package/src/adapters/binance/ticker.yaml +33 -0
- package/src/adapters/bluesky/likes.yaml +35 -0
- package/src/adapters/bluesky/notifications.yaml +30 -0
- package/src/adapters/bluesky/post.yaml +25 -0
- package/src/adapters/chrome/bookmarks.yaml +26 -0
- package/src/adapters/chrome/tabs.yaml +25 -0
- package/src/adapters/cnki/search.yaml +40 -0
- package/src/adapters/cnn/technology.yaml +26 -0
- package/src/adapters/cocoapods/info.yaml +33 -0
- package/src/adapters/coinbase/prices.yaml +27 -0
- package/src/adapters/coinbase/rates.yaml +24 -0
- package/src/adapters/coupang/hot.yaml +29 -0
- package/src/adapters/crates-io/info.yaml +29 -0
- package/src/adapters/crates-io/versions.yaml +33 -0
- package/src/adapters/ctrip/hot.yaml +28 -0
- package/src/adapters/cursor/cursor.ts +91 -1
- package/src/adapters/dangdang/hot.yaml +38 -0
- package/src/adapters/dangdang/search.yaml +43 -0
- package/src/adapters/deepseek/chat.yaml +33 -0
- package/src/adapters/deepseek/models.yaml +18 -0
- package/src/adapters/devto/latest.yaml +29 -0
- package/src/adapters/devto/search.yaml +34 -0
- package/src/adapters/dianping/hot.yaml +43 -0
- package/src/adapters/dianping/search.yaml +48 -0
- package/src/adapters/discord-app/discord-app.ts +99 -1
- package/src/adapters/docker/networks.yaml +20 -0
- package/src/adapters/docker/volumes.yaml +19 -0
- package/src/adapters/docker-hub/info.yaml +26 -0
- package/src/adapters/docker-hub/tags.yaml +34 -0
- package/src/adapters/douban/group-hot.yaml +29 -0
- package/src/adapters/douban/new-movies.yaml +32 -0
- package/src/adapters/douban/tv-hot.yaml +32 -0
- package/src/adapters/doubao/ask.yaml +64 -0
- package/src/adapters/doubao/new.yaml +18 -0
- package/src/adapters/doubao/status.yaml +21 -0
- package/src/adapters/douyu/hot.yaml +34 -0
- package/src/adapters/douyu/search.yaml +42 -0
- package/src/adapters/eastmoney/fund.yaml +36 -0
- package/src/adapters/eastmoney/market.yaml +26 -0
- package/src/adapters/ele/hot.yaml +40 -0
- package/src/adapters/ele/search.yaml +47 -0
- package/src/adapters/exchangerate/list.yaml +25 -0
- package/src/adapters/facebook/marketplace.yaml +43 -0
- package/src/adapters/facebook/post.yaml +29 -0
- package/src/adapters/futu/hot.yaml +49 -0
- package/src/adapters/futu/quote.yaml +46 -0
- package/src/adapters/gitee/repos.yaml +34 -0
- package/src/adapters/github-trending/developers.yaml +33 -0
- package/src/adapters/github-trending/weekly.yaml +34 -0
- package/src/adapters/gitlab/projects.yaml +34 -0
- package/src/adapters/godot/scene-export.yaml +1 -1
- package/src/adapters/hackernews/comments.yaml +36 -0
- package/src/adapters/hackernews/item.yaml +28 -0
- package/src/adapters/hf/datasets.yaml +34 -0
- package/src/adapters/hf/spaces.yaml +34 -0
- package/src/adapters/homebrew/search.yaml +27 -0
- package/src/adapters/huggingface-papers/search.yaml +33 -0
- package/src/adapters/imdb/box-office.yaml +28 -0
- package/src/adapters/infoq/latest.yaml +26 -0
- package/src/adapters/instagram/activity.yaml +45 -0
- package/src/adapters/instagram/highlights.yaml +48 -0
- package/src/adapters/instagram/reels-trending.yaml +51 -0
- package/src/adapters/instagram/reels.yaml +34 -0
- package/src/adapters/instagram/stories.yaml +29 -0
- package/src/adapters/instagram/suggested.yaml +40 -0
- package/src/adapters/instagram/tags.yaml +52 -0
- package/src/adapters/itch-io/search.yaml +35 -0
- package/src/adapters/itch-io/top.yaml +31 -0
- package/src/adapters/ithome/hot.yaml +27 -0
- package/src/adapters/ithome/latest.yaml +26 -0
- package/src/adapters/jianyu/search.yaml +42 -0
- package/src/adapters/ke/ershoufang.yaml +75 -0
- package/src/adapters/ke/xiaoqu.yaml +73 -0
- package/src/adapters/kuaishou/hot.yaml +39 -0
- package/src/adapters/kuaishou/search.yaml +44 -0
- package/src/adapters/linkedin/jobs.yaml +47 -0
- package/src/adapters/lobsters/search.yaml +35 -0
- package/src/adapters/macos/active-app.yaml +16 -0
- package/src/adapters/macos/apps-list.yaml +14 -0
- package/src/adapters/macos/apps.yaml +31 -0
- package/src/adapters/macos/battery.yaml +26 -0
- package/src/adapters/macos/bluetooth.yaml +14 -0
- package/src/adapters/macos/brightness.yaml +22 -0
- package/src/adapters/macos/caffeinate.yaml +25 -0
- package/src/adapters/macos/calendar-create.yaml +81 -0
- package/src/adapters/macos/calendar-list.yaml +53 -0
- package/src/adapters/macos/calendar-today.yaml +30 -0
- package/src/adapters/macos/clipboard.yaml +23 -0
- package/src/adapters/macos/contacts-search.yaml +59 -0
- package/src/adapters/macos/dark-mode.yaml +19 -0
- package/src/adapters/macos/disk-info.yaml +31 -0
- package/src/adapters/macos/disk-usage.yaml +14 -0
- package/src/adapters/macos/do-not-disturb.yaml +21 -0
- package/src/adapters/macos/empty-trash.yaml +16 -0
- package/src/adapters/macos/finder-recent.yaml +24 -0
- package/src/adapters/macos/finder-selection.yaml +22 -0
- package/src/adapters/macos/finder-tags.yaml +40 -0
- package/src/adapters/macos/lock-screen.yaml +16 -0
- package/src/adapters/macos/mail-send.yaml +54 -0
- package/src/adapters/macos/mail-status.yaml +38 -0
- package/src/adapters/macos/messages-send.yaml +42 -0
- package/src/adapters/macos/music-control.yaml +43 -0
- package/src/adapters/macos/music-now.yaml +34 -0
- package/src/adapters/macos/notes-list.yaml +30 -0
- package/src/adapters/macos/notes-search.yaml +45 -0
- package/src/adapters/macos/notification.yaml +27 -0
- package/src/adapters/macos/notify.yaml +46 -0
- package/src/adapters/macos/open-app.yaml +21 -0
- package/src/adapters/macos/open.yaml +24 -0
- package/src/adapters/macos/photos-search.yaml +44 -0
- package/src/adapters/macos/processes.yaml +14 -0
- package/src/adapters/macos/reminder-create.yaml +75 -0
- package/src/adapters/macos/reminders-complete.yaml +33 -0
- package/src/adapters/macos/reminders-list.yaml +28 -0
- package/src/adapters/macos/safari-tabs.yaml +26 -0
- package/src/adapters/macos/say.yaml +36 -0
- package/src/adapters/macos/screen-lock.yaml +16 -0
- package/src/adapters/macos/screenshot.yaml +34 -0
- package/src/adapters/macos/shortcuts-list.yaml +14 -0
- package/src/adapters/macos/shortcuts-run.yaml +28 -0
- package/src/adapters/macos/sleep.yaml +14 -0
- package/src/adapters/macos/spotlight.yaml +43 -0
- package/src/adapters/macos/system-info.yaml +32 -0
- package/src/adapters/macos/trash.yaml +32 -0
- package/src/adapters/macos/uptime.yaml +14 -0
- package/src/adapters/macos/volume.yaml +19 -0
- package/src/adapters/macos/wifi-info.yaml +14 -0
- package/src/adapters/macos/wifi.yaml +63 -0
- package/src/adapters/maimai/search.yaml +62 -0
- package/src/adapters/maoyan/hot.yaml +33 -0
- package/src/adapters/maoyan/search.yaml +40 -0
- package/src/adapters/mastodon/timeline.yaml +33 -0
- package/src/adapters/mastodon/user.yaml +32 -0
- package/src/adapters/medium/article.yaml +22 -0
- package/src/adapters/medium/trending.yaml +30 -0
- package/src/adapters/meituan/hot.yaml +26 -0
- package/src/adapters/mubu/list.yaml +36 -0
- package/src/adapters/mubu/search.yaml +54 -0
- package/src/adapters/netease-music/playlist.yaml +34 -0
- package/src/adapters/netease-music/top.yaml +33 -0
- package/src/adapters/notion/databases.yaml +41 -0
- package/src/adapters/notion/pages.yaml +44 -0
- package/src/adapters/notion/search.yaml +41 -0
- package/src/adapters/npm/downloads.yaml +28 -0
- package/src/adapters/npm/info.yaml +25 -0
- package/src/adapters/npm/search.yaml +35 -0
- package/src/adapters/npm/versions.yaml +33 -0
- package/src/adapters/npm-trends/trending.yaml +17 -0
- package/src/adapters/nytimes/search.yaml +35 -0
- package/src/adapters/obsidian/daily.yaml +23 -0
- package/src/adapters/obsidian/open.yaml +26 -0
- package/src/adapters/obsidian/search.yaml +28 -0
- package/src/adapters/ollama/generate.yaml +33 -0
- package/src/adapters/ollama/models.yaml +29 -0
- package/src/adapters/ollama/ps.yaml +20 -0
- package/src/adapters/openrouter/search.yaml +31 -0
- package/src/adapters/perplexity/ask.yaml +33 -0
- package/src/adapters/pexels/curated.yaml +31 -0
- package/src/adapters/pinduoduo/search.yaml +36 -0
- package/src/adapters/producthunt/search.yaml +41 -0
- package/src/adapters/pypi/search.yaml +37 -0
- package/src/adapters/pypi/versions.yaml +31 -0
- package/src/adapters/quark/ls.yaml +39 -0
- package/src/adapters/quark/search.yaml +39 -0
- package/src/adapters/qweather/forecast.yaml +37 -0
- package/src/adapters/reddit/new.yaml +34 -0
- package/src/adapters/reddit/rising.yaml +33 -0
- package/src/adapters/reddit/top.yaml +40 -0
- package/src/adapters/reddit/trending.yaml +25 -0
- package/src/adapters/replicate/run.yaml +39 -0
- package/src/adapters/reuters/latest.yaml +26 -0
- package/src/adapters/sinafinance/market.yaml +21 -0
- package/src/adapters/slack/messages.yaml +41 -0
- package/src/adapters/slack/post.yaml +32 -0
- package/src/adapters/slack/search.yaml +28 -0
- package/src/adapters/slack/send.yaml +35 -0
- package/src/adapters/slack/status.yaml +19 -0
- package/src/adapters/slack/users.yaml +37 -0
- package/src/adapters/slock/servers.yaml +32 -0
- package/src/adapters/spotify/now-playing.yaml +28 -0
- package/src/adapters/spotify/playlists.yaml +37 -0
- package/src/adapters/spotify/top-tracks.yaml +42 -0
- package/src/adapters/stackoverflow/question.yaml +34 -0
- package/src/adapters/stackoverflow/tags.yaml +30 -0
- package/src/adapters/steam/app-details.yaml +32 -0
- package/src/adapters/steam/new-releases.yaml +28 -0
- package/src/adapters/steam/search.yaml +36 -0
- package/src/adapters/steam/specials.yaml +29 -0
- package/src/adapters/steam/wishlist.yaml +36 -0
- package/src/adapters/substack/trending.yaml +28 -0
- package/src/adapters/taobao/hot.yaml +31 -0
- package/src/adapters/taobao/search.yaml +44 -0
- package/src/adapters/techcrunch/search.yaml +33 -0
- package/src/adapters/theverge/search.yaml +33 -0
- package/src/adapters/threads/hot.yaml +44 -0
- package/src/adapters/threads/search.yaml +47 -0
- package/src/adapters/tiktok/trending.yaml +28 -0
- package/src/adapters/toutiao/hot.yaml +31 -0
- package/src/adapters/toutiao/search.yaml +47 -0
- package/src/adapters/twitch/games.yaml +31 -0
- package/src/adapters/twitch/search.yaml +39 -0
- package/src/adapters/twitch/streams.yaml +38 -0
- package/src/adapters/twitter/lists.yaml +49 -0
- package/src/adapters/twitter/media.yaml +48 -0
- package/src/adapters/twitter/mentions.yaml +38 -0
- package/src/adapters/twitter/mute.yaml +42 -0
- package/src/adapters/twitter/pin.yaml +43 -0
- package/src/adapters/twitter/quotes.yaml +43 -0
- package/src/adapters/twitter/retweets.yaml +44 -0
- package/src/adapters/twitter/spaces.yaml +43 -0
- package/src/adapters/twitter/unmute.yaml +42 -0
- package/src/adapters/unsplash/random.yaml +27 -0
- package/src/adapters/v2ex/search.yaml +36 -0
- package/src/adapters/vscode/extensions.yaml +23 -0
- package/src/adapters/vscode/install-ext.yaml +26 -0
- package/src/adapters/vscode/open.yaml +25 -0
- package/src/adapters/wechat-channels/hot.yaml +39 -0
- package/src/adapters/wechat-channels/search.yaml +57 -0
- package/src/adapters/weibo/trending.yaml +28 -0
- package/src/adapters/weixin/hot.yaml +22 -0
- package/src/adapters/wikipedia/today.yaml +25 -0
- package/src/adapters/xiaohongshu/follow.yaml +35 -0
- package/src/adapters/xiaohongshu/hashtag.yaml +44 -0
- package/src/adapters/xiaohongshu/hot.yaml +34 -0
- package/src/adapters/xiaohongshu/like.yaml +27 -0
- package/src/adapters/xiaohongshu/profile.yaml +39 -0
- package/src/adapters/xiaohongshu/save.yaml +27 -0
- package/src/adapters/xiaohongshu/suggest.yaml +34 -0
- package/src/adapters/xiaohongshu/trending.yaml +35 -0
- package/src/adapters/xiaohongshu/unfollow.yaml +40 -0
- package/src/adapters/xueqiu/market.yaml +25 -0
- package/src/adapters/yahoo-finance/quote.yaml +35 -0
- package/src/adapters/yahoo-finance/search.yaml +42 -0
- package/src/adapters/yahoo-finance/trending.yaml +30 -0
- package/src/adapters/youtube/playlist.yaml +43 -0
- package/src/adapters/youtube/shorts.yaml +42 -0
- package/src/adapters/youtube/trending.yaml +41 -0
- package/src/adapters/zhihu/answer.yaml +29 -0
- package/src/adapters/zhihu/answers.yaml +38 -0
- package/src/adapters/zhihu/article.yaml +27 -0
- package/src/adapters/zhihu/articles.yaml +38 -0
- package/src/adapters/zhihu/collections.yaml +37 -0
- package/src/adapters/zhihu/columns.yaml +38 -0
- package/src/adapters/zhihu/comment.yaml +42 -0
- package/src/adapters/zhihu/followers.yaml +37 -0
- package/src/adapters/zhihu/following.yaml +37 -0
- package/src/adapters/zhihu/pins.yaml +37 -0
- package/src/adapters/zhihu/topic.yaml +35 -0
- package/src/adapters/zhihu/topics.yaml +37 -0
- package/src/adapters/zhihu/trending.yaml +36 -0
- package/src/adapters/zhihu/user.yaml +30 -0
- package/src/adapters/zoom/join.yaml +24 -0
- package/src/adapters/zoom/start.yaml +17 -0
- package/src/hub/external-clis.yaml +343 -0
- package/src/hub/index.ts +128 -0
- package/src/hub/passthrough.ts +85 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
site: instagram
|
|
2
|
+
name: activity
|
|
3
|
+
description: Get recent activity/notifications for logged-in Instagram user
|
|
4
|
+
domain: www.instagram.com
|
|
5
|
+
strategy: intercept
|
|
6
|
+
browser: true
|
|
7
|
+
|
|
8
|
+
args:
|
|
9
|
+
limit:
|
|
10
|
+
type: int
|
|
11
|
+
default: 20
|
|
12
|
+
description: Number of activities
|
|
13
|
+
|
|
14
|
+
columns: [rank, type, user, text, time]
|
|
15
|
+
|
|
16
|
+
pipeline:
|
|
17
|
+
- navigate: https://www.instagram.com
|
|
18
|
+
|
|
19
|
+
- evaluate: |
|
|
20
|
+
(async () => {
|
|
21
|
+
const limit = ${{ args.limit }};
|
|
22
|
+
const headers = { 'X-IG-App-ID': '936619743392459' };
|
|
23
|
+
const opts = { credentials: 'include', headers };
|
|
24
|
+
|
|
25
|
+
const res = await fetch(
|
|
26
|
+
'https://www.instagram.com/api/v1/news/inbox/',
|
|
27
|
+
opts
|
|
28
|
+
);
|
|
29
|
+
if (!res.ok) throw new Error('HTTP ' + res.status + ' - make sure you are logged in');
|
|
30
|
+
const data = await res.json();
|
|
31
|
+
const stories = data?.old_stories || data?.new_stories || [];
|
|
32
|
+
const results = [];
|
|
33
|
+
for (const s of stories) {
|
|
34
|
+
for (const arg of (s?.args?.links || [s.args])) {
|
|
35
|
+
results.push({
|
|
36
|
+
type: s.story_type || s.type || '',
|
|
37
|
+
user: arg?.profile_name || s.args?.profile_name || '',
|
|
38
|
+
text: (s.args?.text || '').replace(/\n/g, ' ').substring(0, 120),
|
|
39
|
+
time: s.args?.timestamp ? new Date(s.args.timestamp * 1000).toISOString().slice(0, 16) : '',
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (results.length >= limit) break;
|
|
43
|
+
}
|
|
44
|
+
return results.slice(0, limit).map((r, i) => ({ rank: i + 1, ...r }));
|
|
45
|
+
})()
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
site: instagram
|
|
2
|
+
name: highlights
|
|
3
|
+
description: List story highlights for an Instagram user
|
|
4
|
+
domain: www.instagram.com
|
|
5
|
+
strategy: intercept
|
|
6
|
+
browser: true
|
|
7
|
+
|
|
8
|
+
args:
|
|
9
|
+
username:
|
|
10
|
+
type: str
|
|
11
|
+
required: true
|
|
12
|
+
positional: true
|
|
13
|
+
description: Instagram username
|
|
14
|
+
|
|
15
|
+
columns: [rank, title, items, id]
|
|
16
|
+
|
|
17
|
+
pipeline:
|
|
18
|
+
- navigate: https://www.instagram.com
|
|
19
|
+
|
|
20
|
+
- evaluate: |
|
|
21
|
+
(async () => {
|
|
22
|
+
const username = ${{ args.username | json }};
|
|
23
|
+
const headers = { 'X-IG-App-ID': '936619743392459' };
|
|
24
|
+
const opts = { credentials: 'include', headers };
|
|
25
|
+
|
|
26
|
+
const r1 = await fetch(
|
|
27
|
+
'https://www.instagram.com/api/v1/users/web_profile_info/?username=' + encodeURIComponent(username),
|
|
28
|
+
opts
|
|
29
|
+
);
|
|
30
|
+
if (!r1.ok) throw new Error('User not found: ' + username);
|
|
31
|
+
const d1 = await r1.json();
|
|
32
|
+
const userId = d1?.data?.user?.id;
|
|
33
|
+
if (!userId) throw new Error('User not found: ' + username);
|
|
34
|
+
|
|
35
|
+
const r2 = await fetch(
|
|
36
|
+
'https://www.instagram.com/api/v1/highlights/' + userId + '/highlights_tray/',
|
|
37
|
+
opts
|
|
38
|
+
);
|
|
39
|
+
if (!r2.ok) throw new Error('Failed to fetch highlights: HTTP ' + r2.status);
|
|
40
|
+
const d2 = await r2.json();
|
|
41
|
+
const trays = d2?.tray || [];
|
|
42
|
+
return trays.map((t, i) => ({
|
|
43
|
+
rank: i + 1,
|
|
44
|
+
title: t.title || '(untitled)',
|
|
45
|
+
items: t.media_count ?? 0,
|
|
46
|
+
id: t.id || '',
|
|
47
|
+
}));
|
|
48
|
+
})()
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
site: instagram
|
|
2
|
+
name: reels-trending
|
|
3
|
+
description: Get trending Instagram Reels
|
|
4
|
+
domain: www.instagram.com
|
|
5
|
+
strategy: intercept
|
|
6
|
+
browser: true
|
|
7
|
+
|
|
8
|
+
args:
|
|
9
|
+
limit:
|
|
10
|
+
type: int
|
|
11
|
+
default: 20
|
|
12
|
+
description: Number of reels
|
|
13
|
+
|
|
14
|
+
columns: [rank, user, caption, likes, views, plays]
|
|
15
|
+
|
|
16
|
+
pipeline:
|
|
17
|
+
- navigate: https://www.instagram.com
|
|
18
|
+
|
|
19
|
+
- evaluate: |
|
|
20
|
+
(async () => {
|
|
21
|
+
const limit = ${{ args.limit }};
|
|
22
|
+
const headers = { 'X-IG-App-ID': '936619743392459' };
|
|
23
|
+
const opts = { credentials: 'include', headers };
|
|
24
|
+
|
|
25
|
+
const res = await fetch(
|
|
26
|
+
'https://www.instagram.com/api/v1/clips/trending/',
|
|
27
|
+
{
|
|
28
|
+
method: 'POST',
|
|
29
|
+
credentials: 'include',
|
|
30
|
+
headers: {
|
|
31
|
+
...headers,
|
|
32
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
33
|
+
},
|
|
34
|
+
body: 'paging_token=&max_id=',
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
if (!res.ok) throw new Error('HTTP ' + res.status + ' - make sure you are logged in');
|
|
38
|
+
const data = await res.json();
|
|
39
|
+
const items = data?.items || [];
|
|
40
|
+
return items.slice(0, limit).map((item, i) => {
|
|
41
|
+
const media = item?.media;
|
|
42
|
+
return {
|
|
43
|
+
rank: i + 1,
|
|
44
|
+
user: media?.user?.username || '',
|
|
45
|
+
caption: (media?.caption?.text || '').replace(/\n/g, ' ').substring(0, 100),
|
|
46
|
+
likes: media?.like_count ?? 0,
|
|
47
|
+
views: media?.view_count ?? media?.play_count ?? 0,
|
|
48
|
+
plays: media?.play_count ?? 0,
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
})()
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
site: instagram
|
|
2
|
+
name: reels
|
|
3
|
+
description: Get Instagram trending reels
|
|
4
|
+
domain: www.instagram.com
|
|
5
|
+
type: web-api
|
|
6
|
+
strategy: cookie
|
|
7
|
+
auth_cookies: [sessionid, csrftoken]
|
|
8
|
+
|
|
9
|
+
args:
|
|
10
|
+
limit:
|
|
11
|
+
type: int
|
|
12
|
+
default: 20
|
|
13
|
+
|
|
14
|
+
pipeline:
|
|
15
|
+
- fetch:
|
|
16
|
+
url: https://www.instagram.com/api/v1/clips/trending/
|
|
17
|
+
method: POST
|
|
18
|
+
body:
|
|
19
|
+
max_id: ""
|
|
20
|
+
page_size: "${{ args.limit }}"
|
|
21
|
+
headers:
|
|
22
|
+
X-CSRFToken: "${{ cookies.csrftoken }}"
|
|
23
|
+
|
|
24
|
+
- select: items
|
|
25
|
+
|
|
26
|
+
- map:
|
|
27
|
+
author: "${{ item.media?.user?.username || '' }}"
|
|
28
|
+
caption: "${{ (item.media?.caption?.text || '') | truncate(100) }}"
|
|
29
|
+
plays: "${{ item.media?.play_count || 0 }}"
|
|
30
|
+
likes: "${{ item.media?.like_count || 0 }}"
|
|
31
|
+
|
|
32
|
+
- limit: ${{ args.limit }}
|
|
33
|
+
|
|
34
|
+
columns: [author, caption, plays, likes]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
site: instagram
|
|
2
|
+
name: stories
|
|
3
|
+
description: Get Instagram stories for a user
|
|
4
|
+
domain: www.instagram.com
|
|
5
|
+
type: web-api
|
|
6
|
+
strategy: cookie
|
|
7
|
+
auth_cookies: [sessionid, csrftoken]
|
|
8
|
+
|
|
9
|
+
args:
|
|
10
|
+
user_id:
|
|
11
|
+
required: true
|
|
12
|
+
positional: true
|
|
13
|
+
description: User ID (numeric)
|
|
14
|
+
|
|
15
|
+
pipeline:
|
|
16
|
+
- fetch:
|
|
17
|
+
url: "https://www.instagram.com/api/v1/feed/reels_media/"
|
|
18
|
+
params:
|
|
19
|
+
reel_ids: "${{ args.user_id }}"
|
|
20
|
+
|
|
21
|
+
- select: "reels_media[0].items"
|
|
22
|
+
|
|
23
|
+
- map:
|
|
24
|
+
id: ${{ item.id }}
|
|
25
|
+
type: "${{ item.media_type === 1 ? 'photo' : 'video' }}"
|
|
26
|
+
taken_at: ${{ item.taken_at }}
|
|
27
|
+
url: "${{ item.image_versions2 ? item.image_versions2.candidates[0].url : '' }}"
|
|
28
|
+
|
|
29
|
+
columns: [id, type, taken_at, url]
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
site: instagram
|
|
2
|
+
name: suggested
|
|
3
|
+
description: Get suggested users to follow on Instagram
|
|
4
|
+
domain: www.instagram.com
|
|
5
|
+
strategy: intercept
|
|
6
|
+
browser: true
|
|
7
|
+
|
|
8
|
+
args:
|
|
9
|
+
limit:
|
|
10
|
+
type: int
|
|
11
|
+
default: 15
|
|
12
|
+
description: Number of suggested users
|
|
13
|
+
|
|
14
|
+
columns: [rank, username, name, verified, followers, bio]
|
|
15
|
+
|
|
16
|
+
pipeline:
|
|
17
|
+
- navigate: https://www.instagram.com
|
|
18
|
+
|
|
19
|
+
- evaluate: |
|
|
20
|
+
(async () => {
|
|
21
|
+
const limit = ${{ args.limit }};
|
|
22
|
+
const headers = { 'X-IG-App-ID': '936619743392459' };
|
|
23
|
+
const opts = { credentials: 'include', headers };
|
|
24
|
+
|
|
25
|
+
const res = await fetch(
|
|
26
|
+
'https://www.instagram.com/api/v1/discover/ayml/',
|
|
27
|
+
opts
|
|
28
|
+
);
|
|
29
|
+
if (!res.ok) throw new Error('HTTP ' + res.status + ' - make sure you are logged in');
|
|
30
|
+
const data = await res.json();
|
|
31
|
+
const users = data?.suggested_users?.suggestions || data?.groups?.[0]?.items || [];
|
|
32
|
+
return users.slice(0, limit).map((item, i) => ({
|
|
33
|
+
rank: i + 1,
|
|
34
|
+
username: item.user?.username || '',
|
|
35
|
+
name: item.user?.full_name || '',
|
|
36
|
+
verified: item.user?.is_verified ? 'Yes' : 'No',
|
|
37
|
+
followers: item.user?.follower_count ?? '',
|
|
38
|
+
bio: (item.user?.biography || item.description || '').replace(/\n/g, ' ').substring(0, 80),
|
|
39
|
+
}));
|
|
40
|
+
})()
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
site: instagram
|
|
2
|
+
name: tags
|
|
3
|
+
description: Browse recent posts for an Instagram hashtag
|
|
4
|
+
domain: www.instagram.com
|
|
5
|
+
strategy: intercept
|
|
6
|
+
browser: true
|
|
7
|
+
|
|
8
|
+
args:
|
|
9
|
+
tag:
|
|
10
|
+
type: str
|
|
11
|
+
required: true
|
|
12
|
+
positional: true
|
|
13
|
+
description: Hashtag (without #)
|
|
14
|
+
limit:
|
|
15
|
+
type: int
|
|
16
|
+
default: 20
|
|
17
|
+
description: Number of posts
|
|
18
|
+
|
|
19
|
+
columns: [rank, user, caption, likes, comments, type]
|
|
20
|
+
|
|
21
|
+
pipeline:
|
|
22
|
+
- navigate: https://www.instagram.com
|
|
23
|
+
|
|
24
|
+
- evaluate: |
|
|
25
|
+
(async () => {
|
|
26
|
+
const tag = ${{ args.tag | json }};
|
|
27
|
+
const limit = ${{ args.limit }};
|
|
28
|
+
const headers = { 'X-IG-App-ID': '936619743392459' };
|
|
29
|
+
const opts = { credentials: 'include', headers };
|
|
30
|
+
|
|
31
|
+
const res = await fetch(
|
|
32
|
+
'https://www.instagram.com/api/v1/tags/web_info/?tag_name=' + encodeURIComponent(tag),
|
|
33
|
+
opts
|
|
34
|
+
);
|
|
35
|
+
if (!res.ok) throw new Error('HTTP ' + res.status + ' - tag not found or not logged in');
|
|
36
|
+
const data = await res.json();
|
|
37
|
+
const sections = data?.data?.recent?.sections || data?.data?.top?.sections || [];
|
|
38
|
+
const posts = [];
|
|
39
|
+
for (const sec of sections) {
|
|
40
|
+
for (const m of (sec?.layout_content?.medias || [])) {
|
|
41
|
+
const media = m?.media;
|
|
42
|
+
if (media) posts.push({
|
|
43
|
+
user: media.user?.username || '',
|
|
44
|
+
caption: (media.caption?.text || '').replace(/\n/g, ' ').substring(0, 100),
|
|
45
|
+
likes: media.like_count ?? 0,
|
|
46
|
+
comments: media.comment_count ?? 0,
|
|
47
|
+
type: media.media_type === 1 ? 'photo' : media.media_type === 2 ? 'video' : 'carousel',
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return posts.slice(0, limit).map((p, i) => ({ rank: i + 1, ...p }));
|
|
52
|
+
})()
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
site: itch-io
|
|
2
|
+
name: search
|
|
3
|
+
description: Search itch.io games
|
|
4
|
+
domain: itch.io
|
|
5
|
+
type: web-api
|
|
6
|
+
strategy: public
|
|
7
|
+
|
|
8
|
+
args:
|
|
9
|
+
query:
|
|
10
|
+
type: str
|
|
11
|
+
required: true
|
|
12
|
+
positional: true
|
|
13
|
+
limit:
|
|
14
|
+
type: int
|
|
15
|
+
default: 20
|
|
16
|
+
|
|
17
|
+
pipeline:
|
|
18
|
+
- fetch:
|
|
19
|
+
url: https://itch.io/api/1/x/search/games
|
|
20
|
+
params:
|
|
21
|
+
query: "${{ args.query }}"
|
|
22
|
+
limit: "${{ args.limit }}"
|
|
23
|
+
|
|
24
|
+
- select: games
|
|
25
|
+
|
|
26
|
+
- map:
|
|
27
|
+
title: ${{ item.title }}
|
|
28
|
+
type: ${{ item.type }}
|
|
29
|
+
price: "${{ item.min_price ? '$' + (item.min_price / 100) : 'Free' }}"
|
|
30
|
+
platforms: "${{ [item.p_windows && 'win', item.p_osx && 'mac', item.p_linux && 'linux'].filter(Boolean).join(', ') }}"
|
|
31
|
+
url: ${{ item.url }}
|
|
32
|
+
|
|
33
|
+
- limit: ${{ args.limit }}
|
|
34
|
+
|
|
35
|
+
columns: [title, type, price, platforms, url]
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
site: itch-io
|
|
2
|
+
name: top
|
|
3
|
+
description: Top rated itch.io games
|
|
4
|
+
domain: itch.io
|
|
5
|
+
type: web-api
|
|
6
|
+
strategy: public
|
|
7
|
+
|
|
8
|
+
args:
|
|
9
|
+
limit:
|
|
10
|
+
type: int
|
|
11
|
+
default: 20
|
|
12
|
+
|
|
13
|
+
pipeline:
|
|
14
|
+
- fetch:
|
|
15
|
+
url: https://itch.io/api/1/x/games
|
|
16
|
+
params:
|
|
17
|
+
sort: rating
|
|
18
|
+
limit: "${{ args.limit }}"
|
|
19
|
+
|
|
20
|
+
- select: games
|
|
21
|
+
|
|
22
|
+
- map:
|
|
23
|
+
rank: ${{ index + 1 }}
|
|
24
|
+
title: ${{ item.title }}
|
|
25
|
+
type: ${{ item.type }}
|
|
26
|
+
price: "${{ item.min_price ? '$' + (item.min_price / 100) : 'Free' }}"
|
|
27
|
+
url: ${{ item.url }}
|
|
28
|
+
|
|
29
|
+
- limit: ${{ args.limit }}
|
|
30
|
+
|
|
31
|
+
columns: [rank, title, type, price, url]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
site: ithome
|
|
2
|
+
name: hot
|
|
3
|
+
description: IT Home hot news
|
|
4
|
+
domain: www.ithome.com
|
|
5
|
+
type: web-api
|
|
6
|
+
strategy: public
|
|
7
|
+
|
|
8
|
+
args:
|
|
9
|
+
limit:
|
|
10
|
+
type: int
|
|
11
|
+
default: 20
|
|
12
|
+
|
|
13
|
+
pipeline:
|
|
14
|
+
- fetch:
|
|
15
|
+
url: https://m.ithome.com/api/news/hot
|
|
16
|
+
|
|
17
|
+
- select: data
|
|
18
|
+
|
|
19
|
+
- map:
|
|
20
|
+
rank: ${{ index + 1 }}
|
|
21
|
+
title: "${{ item.title || '' }}"
|
|
22
|
+
comments: "${{ item.commentcount || 0 }}"
|
|
23
|
+
url: "${{ item.url || '' }}"
|
|
24
|
+
|
|
25
|
+
- limit: ${{ args.limit }}
|
|
26
|
+
|
|
27
|
+
columns: [rank, title, comments, url]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
site: ithome
|
|
2
|
+
name: latest
|
|
3
|
+
description: Latest IT Home news articles
|
|
4
|
+
domain: www.ithome.com
|
|
5
|
+
type: web-api
|
|
6
|
+
strategy: public
|
|
7
|
+
|
|
8
|
+
args:
|
|
9
|
+
limit:
|
|
10
|
+
type: int
|
|
11
|
+
default: 20
|
|
12
|
+
|
|
13
|
+
pipeline:
|
|
14
|
+
- fetch_text:
|
|
15
|
+
url: https://www.ithome.com/rss/
|
|
16
|
+
|
|
17
|
+
- parse_rss:
|
|
18
|
+
fields:
|
|
19
|
+
title: title
|
|
20
|
+
link: link
|
|
21
|
+
pubDate: pubDate
|
|
22
|
+
description: description
|
|
23
|
+
|
|
24
|
+
- limit: "${{ args.limit }}"
|
|
25
|
+
|
|
26
|
+
columns: [title, description, pubDate]
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
site: jianyu
|
|
2
|
+
name: search
|
|
3
|
+
description: Search Jianyu real estate listings
|
|
4
|
+
domain: www.jianyu.com
|
|
5
|
+
type: browser
|
|
6
|
+
strategy: intercept
|
|
7
|
+
browser: true
|
|
8
|
+
|
|
9
|
+
args:
|
|
10
|
+
query:
|
|
11
|
+
type: str
|
|
12
|
+
required: true
|
|
13
|
+
positional: true
|
|
14
|
+
description: Location or property search query
|
|
15
|
+
limit:
|
|
16
|
+
type: int
|
|
17
|
+
default: 20
|
|
18
|
+
description: Maximum results
|
|
19
|
+
|
|
20
|
+
pipeline:
|
|
21
|
+
- navigate:
|
|
22
|
+
url: "https://www.jianyu.com/search?q=${{ args.query | urlencode }}"
|
|
23
|
+
settleMs: 5000
|
|
24
|
+
|
|
25
|
+
- evaluate: |
|
|
26
|
+
(async () => {
|
|
27
|
+
const limit = ${{ args.limit }};
|
|
28
|
+
const cards = document.querySelectorAll(
|
|
29
|
+
'[class*="list-item"], [class*="house-item"], [class*="card"], .search-result-item'
|
|
30
|
+
);
|
|
31
|
+
const items = [];
|
|
32
|
+
for (const card of Array.from(cards).slice(0, limit)) {
|
|
33
|
+
const title = card.querySelector('[class*="title"], h3, h2, a')?.textContent?.trim() || '';
|
|
34
|
+
const price = card.querySelector('[class*="price"], [class*="total"]')?.textContent?.trim() || '';
|
|
35
|
+
const area = card.querySelector('[class*="area"], [class*="size"]')?.textContent?.trim() || '';
|
|
36
|
+
const location = card.querySelector('[class*="location"], [class*="address"], [class*="region"]')?.textContent?.trim() || '';
|
|
37
|
+
if (title) items.push({ rank: items.length + 1, title: title.slice(0, 80), price, area, location });
|
|
38
|
+
}
|
|
39
|
+
return items;
|
|
40
|
+
})()
|
|
41
|
+
|
|
42
|
+
columns: [rank, title, price, area, location]
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
site: ke
|
|
2
|
+
name: ershoufang
|
|
3
|
+
description: Ke.com (Beike) second-hand housing listings
|
|
4
|
+
domain: ke.com
|
|
5
|
+
type: browser
|
|
6
|
+
strategy: intercept
|
|
7
|
+
browser: true
|
|
8
|
+
|
|
9
|
+
args:
|
|
10
|
+
city:
|
|
11
|
+
type: str
|
|
12
|
+
default: bj
|
|
13
|
+
description: "City code (bj=Beijing, sh=Shanghai, gz=Guangzhou, sz=Shenzhen)"
|
|
14
|
+
district:
|
|
15
|
+
type: str
|
|
16
|
+
description: "District pinyin (e.g. chaoyang, haidian, tianhe)"
|
|
17
|
+
limit:
|
|
18
|
+
type: int
|
|
19
|
+
default: 20
|
|
20
|
+
description: Number of results
|
|
21
|
+
|
|
22
|
+
columns:
|
|
23
|
+
[title, community, layout, area, direction, total_price, unit_price, url]
|
|
24
|
+
|
|
25
|
+
pipeline:
|
|
26
|
+
- navigate:
|
|
27
|
+
url: https://${{ args.city }}.ke.com/ershoufang/${{ args.district || '' }}
|
|
28
|
+
settleMs: 3000
|
|
29
|
+
|
|
30
|
+
- evaluate: |
|
|
31
|
+
(() => {
|
|
32
|
+
const href = window.location.href;
|
|
33
|
+
const text = document.body?.innerText || '';
|
|
34
|
+
if (href.includes('captcha') || /请拖动|滑块验证|安全验证/.test(text))
|
|
35
|
+
throw new Error('Captcha triggered — complete verification in browser first');
|
|
36
|
+
if (/请登录|账号登录|扫码登录/.test(text))
|
|
37
|
+
throw new Error('Login required — sign in at ke.com first');
|
|
38
|
+
return true;
|
|
39
|
+
})()
|
|
40
|
+
|
|
41
|
+
- evaluate: |
|
|
42
|
+
(async () => {
|
|
43
|
+
const limit = ${{ args.limit }};
|
|
44
|
+
const cards = document.querySelectorAll('.sellListContent li.clear');
|
|
45
|
+
const results = [];
|
|
46
|
+
for (const card of cards) {
|
|
47
|
+
const titleEl = card.querySelector('.title a');
|
|
48
|
+
if (!titleEl) continue;
|
|
49
|
+
const communityEl = card.querySelector('.positionInfo a');
|
|
50
|
+
const houseInfoEl = card.querySelector('.houseInfo');
|
|
51
|
+
const priceEl = card.querySelector('.totalPrice span');
|
|
52
|
+
const unitPriceEl = card.querySelector('.unitPrice span');
|
|
53
|
+
const houseText = (houseInfoEl ? houseInfoEl.textContent : '').replace(/\s+/g, ' ').trim();
|
|
54
|
+
const parts = houseText.split('|').map(s => s.trim());
|
|
55
|
+
let layout = '', area = '', direction = '';
|
|
56
|
+
for (const p of parts) {
|
|
57
|
+
if (/\d室\d厅/.test(p)) layout = p.match(/(\d室\d厅)/)[1];
|
|
58
|
+
else if (/平米|㎡/.test(p)) area = p;
|
|
59
|
+
else if (/[东南西北]/.test(p)) direction = p;
|
|
60
|
+
}
|
|
61
|
+
if (!layout) { const m = houseText.match(/(\d室\d厅)/); if (m) layout = m[1]; }
|
|
62
|
+
results.push({
|
|
63
|
+
title: (titleEl.textContent || '').trim(),
|
|
64
|
+
community: (communityEl ? communityEl.textContent : '').trim(),
|
|
65
|
+
layout,
|
|
66
|
+
area,
|
|
67
|
+
direction,
|
|
68
|
+
total_price: ((priceEl ? priceEl.textContent : '').trim() || '') + '万',
|
|
69
|
+
unit_price: (unitPriceEl ? unitPriceEl.textContent : '').trim(),
|
|
70
|
+
url: titleEl.href || '',
|
|
71
|
+
});
|
|
72
|
+
if (results.length >= limit) break;
|
|
73
|
+
}
|
|
74
|
+
return results;
|
|
75
|
+
})()
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
site: ke
|
|
2
|
+
name: xiaoqu
|
|
3
|
+
description: Ke.com (Beike) neighborhood/community listings
|
|
4
|
+
domain: ke.com
|
|
5
|
+
type: browser
|
|
6
|
+
strategy: intercept
|
|
7
|
+
browser: true
|
|
8
|
+
|
|
9
|
+
args:
|
|
10
|
+
city:
|
|
11
|
+
type: str
|
|
12
|
+
default: bj
|
|
13
|
+
description: "City code (bj=Beijing, sh=Shanghai, gz=Guangzhou, sz=Shenzhen)"
|
|
14
|
+
district:
|
|
15
|
+
type: str
|
|
16
|
+
description: "District pinyin (e.g. chaoyang, haidian)"
|
|
17
|
+
limit:
|
|
18
|
+
type: int
|
|
19
|
+
default: 20
|
|
20
|
+
description: Number of results
|
|
21
|
+
|
|
22
|
+
columns: [name, district, avg_price, year, on_sale]
|
|
23
|
+
|
|
24
|
+
pipeline:
|
|
25
|
+
- navigate:
|
|
26
|
+
url: https://${{ args.city }}.ke.com/xiaoqu/${{ args.district || '' }}
|
|
27
|
+
settleMs: 3000
|
|
28
|
+
|
|
29
|
+
- evaluate: |
|
|
30
|
+
(() => {
|
|
31
|
+
const href = window.location.href;
|
|
32
|
+
const text = document.body?.innerText || '';
|
|
33
|
+
if (href.includes('captcha') || /请拖动|滑块验证|安全验证/.test(text))
|
|
34
|
+
throw new Error('Captcha triggered — complete verification in browser first');
|
|
35
|
+
if (/请登录|账号登录|扫码登录/.test(text))
|
|
36
|
+
throw new Error('Login required — sign in at ke.com first');
|
|
37
|
+
return true;
|
|
38
|
+
})()
|
|
39
|
+
|
|
40
|
+
- evaluate: |
|
|
41
|
+
(async () => {
|
|
42
|
+
const limit = ${{ args.limit }};
|
|
43
|
+
const selectors = ['.xiaoquListItem', 'li.xiaoquListItem', '.listContent li'];
|
|
44
|
+
let cards = [];
|
|
45
|
+
for (const sel of selectors) {
|
|
46
|
+
cards = document.querySelectorAll(sel);
|
|
47
|
+
if (cards.length > 0) break;
|
|
48
|
+
}
|
|
49
|
+
const results = [];
|
|
50
|
+
for (const card of cards) {
|
|
51
|
+
const titleLink = card.querySelector('.title a');
|
|
52
|
+
const imgLink = card.querySelector('a.img[title], a[title]');
|
|
53
|
+
const nameEl = titleLink || imgLink;
|
|
54
|
+
if (!nameEl) continue;
|
|
55
|
+
const name = (titleLink ? titleLink.textContent : imgLink.getAttribute('title')) || '';
|
|
56
|
+
const priceEl = card.querySelector('.totalPrice span');
|
|
57
|
+
const districtEl = card.querySelector('.positionInfo a, .district a');
|
|
58
|
+
const infoEl = card.querySelector('.positionInfo, .houseInfo, .xiaoquListItemInfo');
|
|
59
|
+
const saleEl = card.querySelector('.xiaoquListItemSellCount a, .houseInfo a');
|
|
60
|
+
const infoText = infoEl ? infoEl.textContent : '';
|
|
61
|
+
const yearMatch = infoText.match(/(\d{4})年/);
|
|
62
|
+
const priceText = (priceEl ? priceEl.textContent : '').trim();
|
|
63
|
+
results.push({
|
|
64
|
+
name: name.trim(),
|
|
65
|
+
district: (districtEl ? districtEl.textContent : '').trim(),
|
|
66
|
+
avg_price: priceText ? priceText + '元/平' : '-',
|
|
67
|
+
year: yearMatch ? yearMatch[1] : '',
|
|
68
|
+
on_sale: (saleEl ? saleEl.textContent : '').trim(),
|
|
69
|
+
});
|
|
70
|
+
if (results.length >= limit) break;
|
|
71
|
+
}
|
|
72
|
+
return results;
|
|
73
|
+
})()
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
site: kuaishou
|
|
2
|
+
name: hot
|
|
3
|
+
description: Kuaishou trending videos
|
|
4
|
+
domain: www.kuaishou.com
|
|
5
|
+
strategy: intercept
|
|
6
|
+
browser: true
|
|
7
|
+
|
|
8
|
+
args:
|
|
9
|
+
limit:
|
|
10
|
+
type: int
|
|
11
|
+
default: 20
|
|
12
|
+
description: Number of videos
|
|
13
|
+
|
|
14
|
+
columns: [rank, title, author, likes, url]
|
|
15
|
+
|
|
16
|
+
pipeline:
|
|
17
|
+
- navigate:
|
|
18
|
+
url: https://www.kuaishou.com/brilliant
|
|
19
|
+
settleMs: 4000
|
|
20
|
+
|
|
21
|
+
- scroll:
|
|
22
|
+
times: 2
|
|
23
|
+
|
|
24
|
+
- evaluate: |
|
|
25
|
+
(async () => {
|
|
26
|
+
const limit = ${{ args.limit }};
|
|
27
|
+
const clean = v => (v || '').replace(/\s+/g, ' ').trim();
|
|
28
|
+
const cards = document.querySelectorAll('[class*="video-card"], [class*="feed-item"], a[href*="/short-video/"]');
|
|
29
|
+
return Array.from(cards).slice(0, limit).map((card, i) => {
|
|
30
|
+
const title = clean(card.querySelector('[class*="title"], [class*="caption"], [class*="desc"]')?.textContent);
|
|
31
|
+
const author = clean(card.querySelector('[class*="author"], [class*="nickname"], [class*="user-name"]')?.textContent);
|
|
32
|
+
const likes = clean(card.querySelector('[class*="like"], [class*="count"]')?.textContent);
|
|
33
|
+
const link = card.querySelector('a[href*="/short-video/"]') || card.closest('a');
|
|
34
|
+
return {
|
|
35
|
+
rank: i + 1, title: title.substring(0, 100), author, likes,
|
|
36
|
+
url: link?.href || '',
|
|
37
|
+
};
|
|
38
|
+
}).filter(r => r.title || r.author);
|
|
39
|
+
})()
|