@jackwener/opencli 0.3.0 → 0.4.1

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.
@@ -0,0 +1,1273 @@
1
+ [
2
+ {
3
+ "site": "bbc",
4
+ "name": "news",
5
+ "description": "",
6
+ "strategy": "cookie",
7
+ "browser": true,
8
+ "args": [],
9
+ "type": "ts",
10
+ "modulePath": "bbc/news.js"
11
+ },
12
+ {
13
+ "site": "bilibili",
14
+ "name": "dynamic",
15
+ "description": "",
16
+ "strategy": "cookie",
17
+ "browser": true,
18
+ "args": [],
19
+ "type": "ts",
20
+ "modulePath": "bilibili/dynamic.js"
21
+ },
22
+ {
23
+ "site": "bilibili",
24
+ "name": "favorite",
25
+ "description": "",
26
+ "strategy": "cookie",
27
+ "browser": true,
28
+ "args": [],
29
+ "type": "ts",
30
+ "modulePath": "bilibili/favorite.js"
31
+ },
32
+ {
33
+ "site": "bilibili",
34
+ "name": "feed",
35
+ "description": "",
36
+ "strategy": "cookie",
37
+ "browser": true,
38
+ "args": [],
39
+ "type": "ts",
40
+ "modulePath": "bilibili/feed.js"
41
+ },
42
+ {
43
+ "site": "bilibili",
44
+ "name": "following",
45
+ "description": "",
46
+ "strategy": "cookie",
47
+ "browser": true,
48
+ "args": [],
49
+ "type": "ts",
50
+ "modulePath": "bilibili/following.js"
51
+ },
52
+ {
53
+ "site": "bilibili",
54
+ "name": "history",
55
+ "description": "",
56
+ "strategy": "cookie",
57
+ "browser": true,
58
+ "args": [],
59
+ "type": "ts",
60
+ "modulePath": "bilibili/history.js"
61
+ },
62
+ {
63
+ "site": "bilibili",
64
+ "name": "hot",
65
+ "description": "B站热门视频",
66
+ "domain": "www.bilibili.com",
67
+ "strategy": "cookie",
68
+ "browser": true,
69
+ "args": [
70
+ {
71
+ "name": "limit",
72
+ "type": "int",
73
+ "default": 20,
74
+ "required": false,
75
+ "help": "Number of videos"
76
+ }
77
+ ],
78
+ "columns": [
79
+ "rank",
80
+ "title",
81
+ "author",
82
+ "play",
83
+ "danmaku"
84
+ ],
85
+ "pipeline": [
86
+ {
87
+ "navigate": "https://www.bilibili.com"
88
+ },
89
+ {
90
+ "evaluate": "(async () => {\n const res = await fetch('https://api.bilibili.com/x/web-interface/popular?ps=${{ args.limit }}&pn=1', {\n credentials: 'include'\n });\n const data = await res.json();\n return (data?.data?.list || []).map((item) => ({\n title: item.title,\n author: item.owner?.name,\n play: item.stat?.view,\n danmaku: item.stat?.danmaku,\n }));\n})()\n"
91
+ },
92
+ {
93
+ "map": {
94
+ "rank": "${{ index + 1 }}",
95
+ "title": "${{ item.title }}",
96
+ "author": "${{ item.author }}",
97
+ "play": "${{ item.play }}",
98
+ "danmaku": "${{ item.danmaku }}"
99
+ }
100
+ },
101
+ {
102
+ "limit": "${{ args.limit }}"
103
+ }
104
+ ],
105
+ "type": "yaml"
106
+ },
107
+ {
108
+ "site": "bilibili",
109
+ "name": "me",
110
+ "description": "",
111
+ "strategy": "cookie",
112
+ "browser": true,
113
+ "args": [],
114
+ "type": "ts",
115
+ "modulePath": "bilibili/me.js"
116
+ },
117
+ {
118
+ "site": "bilibili",
119
+ "name": "ranking",
120
+ "description": "",
121
+ "strategy": "cookie",
122
+ "browser": true,
123
+ "args": [],
124
+ "type": "ts",
125
+ "modulePath": "bilibili/ranking.js"
126
+ },
127
+ {
128
+ "site": "bilibili",
129
+ "name": "search",
130
+ "description": "",
131
+ "strategy": "cookie",
132
+ "browser": true,
133
+ "args": [],
134
+ "type": "ts",
135
+ "modulePath": "bilibili/search.js"
136
+ },
137
+ {
138
+ "site": "bilibili",
139
+ "name": "subtitle",
140
+ "description": "",
141
+ "strategy": "cookie",
142
+ "browser": true,
143
+ "args": [],
144
+ "type": "ts",
145
+ "modulePath": "bilibili/subtitle.js"
146
+ },
147
+ {
148
+ "site": "bilibili",
149
+ "name": "user-videos",
150
+ "description": "",
151
+ "strategy": "cookie",
152
+ "browser": true,
153
+ "args": [],
154
+ "type": "ts",
155
+ "modulePath": "bilibili/user-videos.js"
156
+ },
157
+ {
158
+ "site": "boss",
159
+ "name": "search",
160
+ "description": "",
161
+ "strategy": "cookie",
162
+ "browser": true,
163
+ "args": [],
164
+ "type": "ts",
165
+ "modulePath": "boss/search.js"
166
+ },
167
+ {
168
+ "site": "ctrip",
169
+ "name": "search",
170
+ "description": "",
171
+ "strategy": "cookie",
172
+ "browser": true,
173
+ "args": [],
174
+ "type": "ts",
175
+ "modulePath": "ctrip/search.js"
176
+ },
177
+ {
178
+ "site": "hackernews",
179
+ "name": "top",
180
+ "description": "Hacker News top stories",
181
+ "domain": "news.ycombinator.com",
182
+ "strategy": "public",
183
+ "browser": false,
184
+ "args": [
185
+ {
186
+ "name": "limit",
187
+ "type": "int",
188
+ "default": 20,
189
+ "required": false,
190
+ "help": "Number of stories"
191
+ }
192
+ ],
193
+ "columns": [
194
+ "rank",
195
+ "title",
196
+ "score",
197
+ "author",
198
+ "comments"
199
+ ],
200
+ "pipeline": [
201
+ {
202
+ "fetch": {
203
+ "url": "https://hacker-news.firebaseio.com/v0/topstories.json"
204
+ }
205
+ },
206
+ {
207
+ "limit": 30
208
+ },
209
+ {
210
+ "map": {
211
+ "id": "${{ item }}"
212
+ }
213
+ },
214
+ {
215
+ "fetch": {
216
+ "url": "https://hacker-news.firebaseio.com/v0/item/${{ item.id }}.json"
217
+ }
218
+ },
219
+ {
220
+ "map": {
221
+ "rank": "${{ index + 1 }}",
222
+ "title": "${{ item.title }}",
223
+ "score": "${{ item.score }}",
224
+ "author": "${{ item.by }}",
225
+ "comments": "${{ item.descendants }}",
226
+ "url": "${{ item.url }}"
227
+ }
228
+ },
229
+ {
230
+ "limit": "${{ args.limit }}"
231
+ }
232
+ ],
233
+ "type": "yaml"
234
+ },
235
+ {
236
+ "site": "reddit",
237
+ "name": "frontpage",
238
+ "description": "Reddit Frontpage / r/all",
239
+ "domain": "reddit.com",
240
+ "strategy": "cookie",
241
+ "browser": true,
242
+ "args": [
243
+ {
244
+ "name": "limit",
245
+ "type": "int",
246
+ "default": 15,
247
+ "required": false,
248
+ "help": ""
249
+ }
250
+ ],
251
+ "columns": [
252
+ "title",
253
+ "subreddit",
254
+ "author",
255
+ "upvotes",
256
+ "comments",
257
+ "url"
258
+ ],
259
+ "pipeline": [
260
+ {
261
+ "navigate": "https://www.reddit.com"
262
+ },
263
+ {
264
+ "evaluate": "(async () => {\n const res = await fetch('/r/all.json?limit=${{ args.limit }}', { credentials: 'include' });\n const j = await res.json();\n return j?.data?.children || [];\n})()\n"
265
+ },
266
+ {
267
+ "map": {
268
+ "title": "${{ item.data.title }}",
269
+ "subreddit": "${{ item.data.subreddit_name_prefixed }}",
270
+ "author": "${{ item.data.author }}",
271
+ "upvotes": "${{ item.data.score }}",
272
+ "comments": "${{ item.data.num_comments }}",
273
+ "url": "https://www.reddit.com${{ item.data.permalink }}"
274
+ }
275
+ },
276
+ {
277
+ "limit": "${{ args.limit }}"
278
+ }
279
+ ],
280
+ "type": "yaml"
281
+ },
282
+ {
283
+ "site": "reddit",
284
+ "name": "hot",
285
+ "description": "Reddit 热门帖子",
286
+ "domain": "www.reddit.com",
287
+ "strategy": "cookie",
288
+ "browser": true,
289
+ "args": [
290
+ {
291
+ "name": "subreddit",
292
+ "type": "str",
293
+ "default": "",
294
+ "required": false,
295
+ "help": "Subreddit name (e.g. programming). Empty for frontpage"
296
+ },
297
+ {
298
+ "name": "limit",
299
+ "type": "int",
300
+ "default": 20,
301
+ "required": false,
302
+ "help": "Number of posts"
303
+ }
304
+ ],
305
+ "columns": [
306
+ "rank",
307
+ "title",
308
+ "subreddit",
309
+ "score",
310
+ "comments"
311
+ ],
312
+ "pipeline": [
313
+ {
314
+ "navigate": "https://www.reddit.com"
315
+ },
316
+ {
317
+ "evaluate": "(async () => {\n const sub = ${{ args.subreddit | json }};\n const path = sub ? '/r/' + sub + '/hot.json' : '/hot.json';\n const limit = ${{ args.limit }};\n const res = await fetch(path + '?limit=' + limit + '&raw_json=1', {\n credentials: 'include'\n });\n const d = await res.json();\n return (d?.data?.children || []).map(c => ({\n title: c.data.title,\n subreddit: c.data.subreddit_name_prefixed,\n score: c.data.score,\n comments: c.data.num_comments,\n author: c.data.author,\n url: 'https://www.reddit.com' + c.data.permalink,\n }));\n})()\n"
318
+ },
319
+ {
320
+ "map": {
321
+ "rank": "${{ index + 1 }}",
322
+ "title": "${{ item.title }}",
323
+ "subreddit": "${{ item.subreddit }}",
324
+ "score": "${{ item.score }}",
325
+ "comments": "${{ item.comments }}"
326
+ }
327
+ },
328
+ {
329
+ "limit": "${{ args.limit }}"
330
+ }
331
+ ],
332
+ "type": "yaml"
333
+ },
334
+ {
335
+ "site": "reddit",
336
+ "name": "search",
337
+ "description": "Search Reddit Posts",
338
+ "domain": "reddit.com",
339
+ "strategy": "cookie",
340
+ "browser": true,
341
+ "args": [
342
+ {
343
+ "name": "query",
344
+ "type": "string",
345
+ "required": true,
346
+ "help": ""
347
+ },
348
+ {
349
+ "name": "limit",
350
+ "type": "int",
351
+ "default": 15,
352
+ "required": false,
353
+ "help": ""
354
+ }
355
+ ],
356
+ "columns": [
357
+ "title",
358
+ "subreddit",
359
+ "author",
360
+ "upvotes",
361
+ "comments",
362
+ "url"
363
+ ],
364
+ "pipeline": [
365
+ {
366
+ "navigate": "https://www.reddit.com"
367
+ },
368
+ {
369
+ "evaluate": "(async () => {\n const q = encodeURIComponent('${{ args.query }}');\n const res = await fetch('/search.json?q=' + q + '&limit=${{ args.limit }}', { credentials: 'include' });\n const j = await res.json();\n return j?.data?.children || [];\n})()\n"
370
+ },
371
+ {
372
+ "map": {
373
+ "title": "${{ item.data.title }}",
374
+ "subreddit": "${{ item.data.subreddit_name_prefixed }}",
375
+ "author": "${{ item.data.author }}",
376
+ "upvotes": "${{ item.data.score }}",
377
+ "comments": "${{ item.data.num_comments }}",
378
+ "url": "https://www.reddit.com${{ item.data.permalink }}"
379
+ }
380
+ },
381
+ {
382
+ "limit": "${{ args.limit }}"
383
+ }
384
+ ],
385
+ "type": "yaml"
386
+ },
387
+ {
388
+ "site": "reddit",
389
+ "name": "subreddit",
390
+ "description": "Get posts from a specific Subreddit",
391
+ "domain": "reddit.com",
392
+ "strategy": "cookie",
393
+ "browser": true,
394
+ "args": [
395
+ {
396
+ "name": "name",
397
+ "type": "string",
398
+ "required": true,
399
+ "help": ""
400
+ },
401
+ {
402
+ "name": "sort",
403
+ "type": "string",
404
+ "default": "hot",
405
+ "required": false,
406
+ "help": "Sorting method: hot, new, top, rising"
407
+ },
408
+ {
409
+ "name": "limit",
410
+ "type": "int",
411
+ "default": 15,
412
+ "required": false,
413
+ "help": ""
414
+ }
415
+ ],
416
+ "columns": [
417
+ "title",
418
+ "author",
419
+ "upvotes",
420
+ "comments",
421
+ "url"
422
+ ],
423
+ "pipeline": [
424
+ {
425
+ "navigate": "https://www.reddit.com"
426
+ },
427
+ {
428
+ "evaluate": "(async () => {\n let sub = '${{ args.name }}';\n if (sub.startsWith('r/')) sub = sub.slice(2);\n const sort = '${{ args.sort }}';\n const res = await fetch('/r/' + sub + '/' + sort + '.json?limit=${{ args.limit }}', { credentials: 'include' });\n const j = await res.json();\n return j?.data?.children || [];\n})()\n"
429
+ },
430
+ {
431
+ "map": {
432
+ "title": "${{ item.data.title }}",
433
+ "author": "${{ item.data.author }}",
434
+ "upvotes": "${{ item.data.score }}",
435
+ "comments": "${{ item.data.num_comments }}",
436
+ "url": "https://www.reddit.com${{ item.data.permalink }}"
437
+ }
438
+ },
439
+ {
440
+ "limit": "${{ args.limit }}"
441
+ }
442
+ ],
443
+ "type": "yaml"
444
+ },
445
+ {
446
+ "site": "reuters",
447
+ "name": "search",
448
+ "description": "",
449
+ "strategy": "cookie",
450
+ "browser": true,
451
+ "args": [],
452
+ "type": "ts",
453
+ "modulePath": "reuters/search.js"
454
+ },
455
+ {
456
+ "site": "smzdm",
457
+ "name": "search",
458
+ "description": "",
459
+ "strategy": "cookie",
460
+ "browser": true,
461
+ "args": [],
462
+ "type": "ts",
463
+ "modulePath": "smzdm/search.js"
464
+ },
465
+ {
466
+ "site": "twitter",
467
+ "name": "bookmarks",
468
+ "description": "获取 Twitter 书签列表",
469
+ "domain": "x.com",
470
+ "strategy": "cookie",
471
+ "browser": true,
472
+ "args": [
473
+ {
474
+ "name": "limit",
475
+ "type": "int",
476
+ "default": 20,
477
+ "required": false,
478
+ "help": "Number of bookmarks to return (default 20)"
479
+ }
480
+ ],
481
+ "columns": [
482
+ "author",
483
+ "text",
484
+ "likes",
485
+ "url"
486
+ ],
487
+ "pipeline": [
488
+ {
489
+ "navigate": "https://x.com/i/bookmarks"
490
+ },
491
+ {
492
+ "wait": 2
493
+ },
494
+ {
495
+ "evaluate": "(async () => {\n const ct0 = document.cookie.split(';').map(c=>c.trim()).find(c=>c.startsWith('ct0='))?.split('=')[1];\n if (!ct0) throw new Error('No ct0 cookie. Hint: Not logged into x.com.');\n const bearer = decodeURIComponent('AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA');\n const _h = {'Authorization':'Bearer '+bearer, 'X-Csrf-Token':ct0, 'X-Twitter-Auth-Type':'OAuth2Session', 'X-Twitter-Active-User':'yes'};\n\n const count = Math.min(${{ args.limit }}, 100);\n const variables = JSON.stringify({count, includePromotedContent: false});\n const features = JSON.stringify({\n rweb_video_screen_enabled: false, profile_label_improvements_pcf_label_in_post_enabled: true,\n responsive_web_profile_redirect_enabled: false, rweb_tipjar_consumption_enabled: false,\n verified_phone_label_enabled: false, creator_subscriptions_tweet_preview_api_enabled: true,\n responsive_web_graphql_timeline_navigation_enabled: true,\n responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,\n premium_content_api_read_enabled: false, communities_web_enable_tweet_community_results_fetch: true,\n c9s_tweet_anatomy_moderator_badge_enabled: true,\n articles_preview_enabled: true, responsive_web_edit_tweet_api_enabled: true,\n graphql_is_translatable_rweb_tweet_is_translatable_enabled: true,\n view_counts_everywhere_api_enabled: true, longform_notetweets_consumption_enabled: true,\n responsive_web_twitter_article_tweet_consumption_enabled: true,\n tweet_awards_web_tipping_enabled: false,\n content_disclosure_indicator_enabled: true, content_disclosure_ai_generated_indicator_enabled: true,\n freedom_of_speech_not_reach_fetch_enabled: true, standardized_nudges_misinfo: true,\n tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: true,\n longform_notetweets_rich_text_read_enabled: true, longform_notetweets_inline_media_enabled: false,\n responsive_web_enhance_cards_enabled: false\n });\n const url = '/i/api/graphql/Fy0QMy4q_aZCpkO0PnyLYw/Bookmarks?variables=' + encodeURIComponent(variables) + '&features=' + encodeURIComponent(features);\n const resp = await fetch(url, {headers: _h, credentials: 'include'});\n if (!resp.ok) throw new Error('HTTP ' + resp.status + '. Hint: queryId may have changed.');\n const d = await resp.json();\n\n const instructions = d.data?.bookmark_timeline_v2?.timeline?.instructions || d.data?.bookmark_timeline?.timeline?.instructions || [];\n let tweets = [], seen = new Set();\n for (const inst of instructions) {\n for (const entry of (inst.entries || [])) {\n const r = entry.content?.itemContent?.tweet_results?.result;\n if (!r) continue;\n const tw = r.tweet || r;\n const l = tw.legacy || {};\n if (!tw.rest_id || seen.has(tw.rest_id)) continue;\n seen.add(tw.rest_id);\n const u = tw.core?.user_results?.result;\n const nt = tw.note_tweet?.note_tweet_results?.result?.text;\n const screenName = u?.legacy?.screen_name || u?.core?.screen_name;\n tweets.push({\n id: tw.rest_id, \n author: screenName,\n name: u?.legacy?.name || u?.core?.name,\n url: 'https://x.com/' + (screenName || '_') + '/status/' + tw.rest_id,\n text: nt || l.full_text || '',\n likes: l.favorite_count, \n retweets: l.retweet_count,\n created_at: l.created_at\n });\n }\n }\n return tweets;\n})()\n"
496
+ },
497
+ {
498
+ "map": {
499
+ "author": "${{ item.author }}",
500
+ "text": "${{ item.text }}",
501
+ "likes": "${{ item.likes }}",
502
+ "url": "${{ item.url }}"
503
+ }
504
+ },
505
+ {
506
+ "limit": "${{ args.limit }}"
507
+ }
508
+ ],
509
+ "type": "yaml"
510
+ },
511
+ {
512
+ "site": "twitter",
513
+ "name": "profile",
514
+ "description": "",
515
+ "strategy": "cookie",
516
+ "browser": true,
517
+ "args": [],
518
+ "type": "ts",
519
+ "modulePath": "twitter/profile.js"
520
+ },
521
+ {
522
+ "site": "twitter",
523
+ "name": "search",
524
+ "description": "",
525
+ "strategy": "cookie",
526
+ "browser": true,
527
+ "args": [],
528
+ "type": "ts",
529
+ "modulePath": "twitter/search.js"
530
+ },
531
+ {
532
+ "site": "twitter",
533
+ "name": "timeline",
534
+ "description": "",
535
+ "strategy": "cookie",
536
+ "browser": true,
537
+ "args": [],
538
+ "type": "ts",
539
+ "modulePath": "twitter/timeline.js"
540
+ },
541
+ {
542
+ "site": "twitter",
543
+ "name": "trending",
544
+ "description": "Twitter/X trending topics",
545
+ "domain": "x.com",
546
+ "strategy": "cookie",
547
+ "browser": true,
548
+ "args": [
549
+ {
550
+ "name": "limit",
551
+ "type": "int",
552
+ "default": 20,
553
+ "required": false,
554
+ "help": "Number of trends to show"
555
+ }
556
+ ],
557
+ "columns": [
558
+ "rank",
559
+ "topic",
560
+ "tweets"
561
+ ],
562
+ "pipeline": [
563
+ {
564
+ "navigate": "https://x.com/explore/tabs/trending"
565
+ },
566
+ {
567
+ "evaluate": "(async () => {\n const cookies = document.cookie.split(';').reduce((acc, c) => {\n const [k, v] = c.trim().split('=');\n acc[k] = v;\n return acc;\n }, {});\n const csrfToken = cookies['ct0'] || '';\n const bearerToken = 'AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA';\n const res = await fetch('/i/api/2/guide.json?include_page_configuration=true', {\n credentials: 'include',\n headers: { 'x-twitter-active-user': 'yes', 'x-csrf-token': csrfToken, 'authorization': 'Bearer ' + bearerToken }\n });\n const data = await res.json();\n const trends = data?.timeline?.instructions?.[1]?.addEntries?.entries || [];\n return trends.filter(e => e.content?.timelineModule).flatMap(e => e.content.timelineModule.items || []).map(t => t?.item?.content?.trend).filter(Boolean);\n})()\n"
568
+ },
569
+ {
570
+ "map": {
571
+ "rank": "${{ index + 1 }}",
572
+ "topic": "${{ item.name }}",
573
+ "tweets": "${{ item.tweetCount || 'N/A' }}"
574
+ }
575
+ },
576
+ {
577
+ "limit": "${{ args.limit }}"
578
+ }
579
+ ],
580
+ "type": "yaml"
581
+ },
582
+ {
583
+ "site": "v2ex",
584
+ "name": "hot",
585
+ "description": "V2EX 热门话题",
586
+ "domain": "www.v2ex.com",
587
+ "strategy": "public",
588
+ "browser": false,
589
+ "args": [
590
+ {
591
+ "name": "limit",
592
+ "type": "int",
593
+ "default": 20,
594
+ "required": false,
595
+ "help": "Number of topics"
596
+ }
597
+ ],
598
+ "columns": [
599
+ "rank",
600
+ "title",
601
+ "replies"
602
+ ],
603
+ "pipeline": [
604
+ {
605
+ "fetch": {
606
+ "url": "https://www.v2ex.com/api/topics/hot.json"
607
+ }
608
+ },
609
+ {
610
+ "map": {
611
+ "rank": "${{ index + 1 }}",
612
+ "title": "${{ item.title }}",
613
+ "replies": "${{ item.replies }}"
614
+ }
615
+ },
616
+ {
617
+ "limit": "${{ args.limit }}"
618
+ }
619
+ ],
620
+ "type": "yaml"
621
+ },
622
+ {
623
+ "site": "v2ex",
624
+ "name": "latest",
625
+ "description": "V2EX 最新话题",
626
+ "domain": "www.v2ex.com",
627
+ "strategy": "public",
628
+ "browser": false,
629
+ "args": [
630
+ {
631
+ "name": "limit",
632
+ "type": "int",
633
+ "default": 20,
634
+ "required": false,
635
+ "help": "Number of topics"
636
+ }
637
+ ],
638
+ "columns": [
639
+ "rank",
640
+ "title",
641
+ "replies"
642
+ ],
643
+ "pipeline": [
644
+ {
645
+ "fetch": {
646
+ "url": "https://www.v2ex.com/api/topics/latest.json"
647
+ }
648
+ },
649
+ {
650
+ "map": {
651
+ "rank": "${{ index + 1 }}",
652
+ "title": "${{ item.title }}",
653
+ "replies": "${{ item.replies }}"
654
+ }
655
+ },
656
+ {
657
+ "limit": "${{ args.limit }}"
658
+ }
659
+ ],
660
+ "type": "yaml"
661
+ },
662
+ {
663
+ "site": "v2ex",
664
+ "name": "topic",
665
+ "description": "V2EX 主题详情和回复",
666
+ "domain": "www.v2ex.com",
667
+ "strategy": "public",
668
+ "browser": false,
669
+ "args": [
670
+ {
671
+ "name": "id",
672
+ "type": "str",
673
+ "required": true,
674
+ "help": "Topic ID"
675
+ }
676
+ ],
677
+ "columns": [
678
+ "title",
679
+ "replies",
680
+ "url"
681
+ ],
682
+ "pipeline": [
683
+ {
684
+ "fetch": {
685
+ "url": "https://www.v2ex.com/api/topics/show.json",
686
+ "params": {
687
+ "id": "${{ args.id }}"
688
+ }
689
+ }
690
+ },
691
+ {
692
+ "map": {
693
+ "title": "${{ item.title }}",
694
+ "replies": "${{ item.replies }}",
695
+ "url": "${{ item.url }}"
696
+ }
697
+ },
698
+ {
699
+ "limit": 1
700
+ }
701
+ ],
702
+ "type": "yaml"
703
+ },
704
+ {
705
+ "site": "weibo",
706
+ "name": "hot",
707
+ "description": "",
708
+ "strategy": "cookie",
709
+ "browser": true,
710
+ "args": [],
711
+ "type": "ts",
712
+ "modulePath": "weibo/hot.js"
713
+ },
714
+ {
715
+ "site": "xiaohongshu",
716
+ "name": "feed",
717
+ "description": "小红书首页推荐 Feed (via Pinia Store Action)",
718
+ "domain": "www.xiaohongshu.com",
719
+ "strategy": "intercept",
720
+ "browser": true,
721
+ "args": [
722
+ {
723
+ "name": "limit",
724
+ "type": "int",
725
+ "default": 20,
726
+ "required": false,
727
+ "help": "Number of items to return"
728
+ }
729
+ ],
730
+ "columns": [
731
+ "title",
732
+ "author",
733
+ "likes",
734
+ "type",
735
+ "url"
736
+ ],
737
+ "pipeline": [
738
+ {
739
+ "navigate": "https://www.xiaohongshu.com/explore"
740
+ },
741
+ {
742
+ "wait": 3
743
+ },
744
+ {
745
+ "tap": {
746
+ "store": "feed",
747
+ "action": "fetchFeeds",
748
+ "capture": "homefeed",
749
+ "select": "data.items",
750
+ "timeout": 8
751
+ }
752
+ },
753
+ {
754
+ "map": {
755
+ "id": "${{ item.id }}",
756
+ "title": "${{ item.note_card.display_title }}",
757
+ "type": "${{ item.note_card.type }}",
758
+ "author": "${{ item.note_card.user.nickname }}",
759
+ "likes": "${{ item.note_card.interact_info.liked_count }}",
760
+ "url": "https://www.xiaohongshu.com/explore/${{ item.id }}"
761
+ }
762
+ },
763
+ {
764
+ "limit": "${{ args.limit | default(20) }}"
765
+ }
766
+ ],
767
+ "type": "yaml"
768
+ },
769
+ {
770
+ "site": "xiaohongshu",
771
+ "name": "notifications",
772
+ "description": "小红书通知 (mentions/likes/connections)",
773
+ "domain": "www.xiaohongshu.com",
774
+ "strategy": "intercept",
775
+ "browser": true,
776
+ "args": [
777
+ {
778
+ "name": "type",
779
+ "type": "str",
780
+ "default": "mentions",
781
+ "required": false,
782
+ "help": "Notification type: mentions, likes, or connections"
783
+ },
784
+ {
785
+ "name": "limit",
786
+ "type": "int",
787
+ "default": 20,
788
+ "required": false,
789
+ "help": "Number of notifications to return"
790
+ }
791
+ ],
792
+ "columns": [
793
+ "rank",
794
+ "user",
795
+ "action",
796
+ "content",
797
+ "note",
798
+ "time"
799
+ ],
800
+ "pipeline": [
801
+ {
802
+ "navigate": "https://www.xiaohongshu.com/notification"
803
+ },
804
+ {
805
+ "wait": 3
806
+ },
807
+ {
808
+ "tap": {
809
+ "store": "notification",
810
+ "action": "getNotification",
811
+ "args": [
812
+ "${{ args.type | default('mentions') }}"
813
+ ],
814
+ "capture": "/you/",
815
+ "select": "data.message_list",
816
+ "timeout": 8
817
+ }
818
+ },
819
+ {
820
+ "map": {
821
+ "rank": "${{ index + 1 }}",
822
+ "user": "${{ item.user_info.nickname }}",
823
+ "action": "${{ item.title }}",
824
+ "content": "${{ item.comment_info.content }}",
825
+ "note": "${{ item.item_info.content }}",
826
+ "time": "${{ item.time }}"
827
+ }
828
+ },
829
+ {
830
+ "limit": "${{ args.limit | default(20) }}"
831
+ }
832
+ ],
833
+ "type": "yaml"
834
+ },
835
+ {
836
+ "site": "xiaohongshu",
837
+ "name": "search",
838
+ "description": "",
839
+ "strategy": "cookie",
840
+ "browser": true,
841
+ "args": [],
842
+ "type": "ts",
843
+ "modulePath": "xiaohongshu/search.js"
844
+ },
845
+ {
846
+ "site": "xiaohongshu",
847
+ "name": "user",
848
+ "description": "",
849
+ "strategy": "cookie",
850
+ "browser": true,
851
+ "args": [],
852
+ "type": "ts",
853
+ "modulePath": "xiaohongshu/user.js"
854
+ },
855
+ {
856
+ "site": "xueqiu",
857
+ "name": "feed",
858
+ "description": "获取雪球首页时间线(关注用户的动态)",
859
+ "domain": "xueqiu.com",
860
+ "strategy": "cookie",
861
+ "browser": true,
862
+ "args": [
863
+ {
864
+ "name": "page",
865
+ "type": "int",
866
+ "default": 1,
867
+ "required": false,
868
+ "help": "页码,默认 1"
869
+ },
870
+ {
871
+ "name": "limit",
872
+ "type": "int",
873
+ "default": 20,
874
+ "required": false,
875
+ "help": "每页数量,默认 20"
876
+ }
877
+ ],
878
+ "columns": [
879
+ "author",
880
+ "text",
881
+ "likes",
882
+ "replies",
883
+ "url"
884
+ ],
885
+ "pipeline": [
886
+ {
887
+ "navigate": "https://xueqiu.com"
888
+ },
889
+ {
890
+ "evaluate": "(async () => {\n const page = ${{ args.page }};\n const count = ${{ args.limit }};\n const resp = await fetch(`https://xueqiu.com/v4/statuses/home_timeline.json?page=${page}&count=${count}`, {credentials: 'include'});\n if (!resp.ok) throw new Error('HTTP ' + resp.status + ' Hint: Not logged in?');\n const d = await resp.json();\n \n const strip = (html) => (html || '').replace(/<[^>]+>/g, '').replace(/&nbsp;/g, ' ').replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').trim();\n const list = d.home_timeline || d.list || [];\n return list.map(item => {\n const user = item.user || {};\n return {\n id: item.id,\n text: strip(item.description).substring(0, 200),\n url: 'https://xueqiu.com/' + user.id + '/' + item.id,\n author: user.screen_name,\n likes: item.fav_count,\n retweets: item.retweet_count,\n replies: item.reply_count,\n created_at: item.created_at ? new Date(item.created_at).toISOString() : null\n };\n });\n})()\n"
891
+ },
892
+ {
893
+ "map": {
894
+ "author": "${{ item.author }}",
895
+ "text": "${{ item.text }}",
896
+ "likes": "${{ item.likes }}",
897
+ "replies": "${{ item.replies }}",
898
+ "url": "${{ item.url }}"
899
+ }
900
+ },
901
+ {
902
+ "limit": "${{ args.limit }}"
903
+ }
904
+ ],
905
+ "type": "yaml"
906
+ },
907
+ {
908
+ "site": "xueqiu",
909
+ "name": "hot-stock",
910
+ "description": "获取雪球热门股票榜",
911
+ "domain": "xueqiu.com",
912
+ "strategy": "cookie",
913
+ "browser": true,
914
+ "args": [
915
+ {
916
+ "name": "limit",
917
+ "type": "int",
918
+ "default": 20,
919
+ "required": false,
920
+ "help": "返回数量,默认 20,最大 50"
921
+ },
922
+ {
923
+ "name": "type",
924
+ "type": "str",
925
+ "default": "10",
926
+ "required": false,
927
+ "help": "榜单类型 10=人气榜(默认) 12=关注榜"
928
+ }
929
+ ],
930
+ "columns": [
931
+ "rank",
932
+ "symbol",
933
+ "name",
934
+ "price",
935
+ "changePercent",
936
+ "heat"
937
+ ],
938
+ "pipeline": [
939
+ {
940
+ "navigate": "https://xueqiu.com"
941
+ },
942
+ {
943
+ "evaluate": "(async () => {\n const count = ${{ args.limit }};\n const type = ${{ args.type | json }};\n const resp = await fetch(`https://stock.xueqiu.com/v5/stock/hot_stock/list.json?size=${count}&type=${type}`, {credentials: 'include'});\n if (!resp.ok) throw new Error('HTTP ' + resp.status + ' Hint: Not logged in?');\n const d = await resp.json();\n if (!d.data || !d.data.items) throw new Error('获取失败');\n return d.data.items.map((s, i) => ({\n rank: i + 1,\n symbol: s.symbol,\n name: s.name,\n price: s.current,\n changePercent: s.percent != null ? s.percent.toFixed(2) + '%' : null,\n heat: s.value,\n rank_change: s.rank_change,\n url: 'https://xueqiu.com/S/' + s.symbol\n }));\n})()\n"
944
+ },
945
+ {
946
+ "map": {
947
+ "rank": "${{ item.rank }}",
948
+ "symbol": "${{ item.symbol }}",
949
+ "name": "${{ item.name }}",
950
+ "price": "${{ item.price }}",
951
+ "changePercent": "${{ item.changePercent }}",
952
+ "heat": "${{ item.heat }}"
953
+ }
954
+ },
955
+ {
956
+ "limit": "${{ args.limit }}"
957
+ }
958
+ ],
959
+ "type": "yaml"
960
+ },
961
+ {
962
+ "site": "xueqiu",
963
+ "name": "hot",
964
+ "description": "获取雪球热门动态",
965
+ "domain": "xueqiu.com",
966
+ "strategy": "cookie",
967
+ "browser": true,
968
+ "args": [
969
+ {
970
+ "name": "limit",
971
+ "type": "int",
972
+ "default": 20,
973
+ "required": false,
974
+ "help": "返回数量,默认 20,最大 50"
975
+ }
976
+ ],
977
+ "columns": [
978
+ "rank",
979
+ "author",
980
+ "text",
981
+ "likes",
982
+ "url"
983
+ ],
984
+ "pipeline": [
985
+ {
986
+ "navigate": "https://xueqiu.com"
987
+ },
988
+ {
989
+ "evaluate": "(async () => {\n const resp = await fetch('https://xueqiu.com/statuses/hot/listV3.json?source=hot&page=1', {credentials: 'include'});\n if (!resp.ok) throw new Error('HTTP ' + resp.status + ' Hint: Not logged in?');\n const d = await resp.json();\n const list = d.list || [];\n \n const strip = (html) => (html || '').replace(/<[^>]+>/g, '').replace(/&nbsp;/g, ' ').replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').trim();\n return list.map((item, i) => {\n const user = item.user || {};\n return {\n rank: i + 1,\n text: strip(item.description).substring(0, 200),\n url: 'https://xueqiu.com/' + user.id + '/' + item.id,\n author: user.screen_name,\n likes: item.fav_count,\n retweets: item.retweet_count,\n replies: item.reply_count\n };\n });\n})()\n"
990
+ },
991
+ {
992
+ "map": {
993
+ "rank": "${{ item.rank }}",
994
+ "author": "${{ item.author }}",
995
+ "text": "${{ item.text }}",
996
+ "likes": "${{ item.likes }}",
997
+ "url": "${{ item.url }}"
998
+ }
999
+ },
1000
+ {
1001
+ "limit": "${{ args.limit }}"
1002
+ }
1003
+ ],
1004
+ "type": "yaml"
1005
+ },
1006
+ {
1007
+ "site": "xueqiu",
1008
+ "name": "search",
1009
+ "description": "搜索雪球股票(代码或名称)",
1010
+ "domain": "xueqiu.com",
1011
+ "strategy": "cookie",
1012
+ "browser": true,
1013
+ "args": [
1014
+ {
1015
+ "name": "query",
1016
+ "type": "str",
1017
+ "required": false,
1018
+ "help": "搜索关键词,如 茅台、AAPL、腾讯"
1019
+ },
1020
+ {
1021
+ "name": "limit",
1022
+ "type": "int",
1023
+ "default": 10,
1024
+ "required": false,
1025
+ "help": "返回数量,默认 10"
1026
+ }
1027
+ ],
1028
+ "columns": [
1029
+ "symbol",
1030
+ "name",
1031
+ "exchange",
1032
+ "price",
1033
+ "changePercent"
1034
+ ],
1035
+ "pipeline": [
1036
+ {
1037
+ "navigate": "https://xueqiu.com"
1038
+ },
1039
+ {
1040
+ "evaluate": "(async () => {\n const query = ${{ args.query | json }};\n const count = ${{ args.limit }};\n if (!query) throw new Error('Missing argument: query');\n const resp = await fetch(`https://xueqiu.com/stock/search.json?code=${encodeURIComponent(query)}&size=${count}`, {credentials: 'include'});\n if (!resp.ok) throw new Error('HTTP ' + resp.status + ' Hint: Not logged in?');\n const d = await resp.json();\n return (d.stocks || []).map(s => {\n let symbol = '';\n if (s.exchange === 'SH' || s.exchange === 'SZ' || s.exchange === 'BJ') {\n symbol = s.code.startsWith(s.exchange) ? s.code : s.exchange + s.code;\n } else {\n symbol = s.code;\n }\n return {\n symbol: symbol,\n name: s.name,\n exchange: s.exchange,\n price: s.current,\n changePercent: s.percentage != null ? s.percentage.toFixed(2) + '%' : null,\n url: 'https://xueqiu.com/S/' + symbol\n };\n });\n})()\n"
1041
+ },
1042
+ {
1043
+ "map": {
1044
+ "symbol": "${{ item.symbol }}",
1045
+ "name": "${{ item.name }}",
1046
+ "exchange": "${{ item.exchange }}",
1047
+ "price": "${{ item.price }}",
1048
+ "changePercent": "${{ item.changePercent }}"
1049
+ }
1050
+ },
1051
+ {
1052
+ "limit": "${{ args.limit }}"
1053
+ }
1054
+ ],
1055
+ "type": "yaml"
1056
+ },
1057
+ {
1058
+ "site": "xueqiu",
1059
+ "name": "stock",
1060
+ "description": "获取雪球股票实时行情",
1061
+ "domain": "xueqiu.com",
1062
+ "strategy": "cookie",
1063
+ "browser": true,
1064
+ "args": [
1065
+ {
1066
+ "name": "symbol",
1067
+ "type": "str",
1068
+ "required": false,
1069
+ "help": "股票代码,如 SH600519、SZ000858、AAPL、00700"
1070
+ }
1071
+ ],
1072
+ "columns": [
1073
+ "name",
1074
+ "symbol",
1075
+ "price",
1076
+ "changePercent",
1077
+ "marketCap"
1078
+ ],
1079
+ "pipeline": [
1080
+ {
1081
+ "navigate": "https://xueqiu.com"
1082
+ },
1083
+ {
1084
+ "evaluate": "(async () => {\n const symbol = (${{ args.symbol | json }} || '').toUpperCase();\n if (!symbol) throw new Error('Missing argument: symbol');\n const resp = await fetch(`https://stock.xueqiu.com/v5/stock/batch/quote.json?symbol=${encodeURIComponent(symbol)}`, {credentials: 'include'});\n if (!resp.ok) throw new Error('HTTP ' + resp.status + ' Hint: Not logged in?');\n const d = await resp.json();\n if (!d.data || !d.data.items || d.data.items.length === 0) throw new Error('未找到股票: ' + symbol);\n \n function fmtAmount(v) {\n if (v == null) return null;\n if (Math.abs(v) >= 1e12) return (v / 1e12).toFixed(2) + '万亿';\n if (Math.abs(v) >= 1e8) return (v / 1e8).toFixed(2) + '亿';\n if (Math.abs(v) >= 1e4) return (v / 1e4).toFixed(2) + '万';\n return v.toString();\n }\n \n const item = d.data.items[0];\n const q = item.quote || {};\n const m = item.market || {};\n \n return [{\n name: q.name,\n symbol: q.symbol,\n exchange: q.exchange,\n currency: q.currency,\n price: q.current,\n change: q.chg,\n changePercent: q.percent != null ? q.percent.toFixed(2) + '%' : null,\n open: q.open,\n high: q.high,\n low: q.low,\n prevClose: q.last_close,\n amplitude: q.amplitude != null ? q.amplitude.toFixed(2) + '%' : null,\n volume: q.volume,\n amount: fmtAmount(q.amount),\n turnover_rate: q.turnover_rate != null ? q.turnover_rate.toFixed(2) + '%' : null,\n marketCap: fmtAmount(q.market_capital),\n floatMarketCap: fmtAmount(q.float_market_capital),\n ytdPercent: q.current_year_percent != null ? q.current_year_percent.toFixed(2) + '%' : null,\n market_status: m.status || null,\n time: q.timestamp ? new Date(q.timestamp).toISOString() : null,\n url: 'https://xueqiu.com/S/' + q.symbol\n }];\n})()\n"
1085
+ },
1086
+ {
1087
+ "map": {
1088
+ "name": "${{ item.name }}",
1089
+ "symbol": "${{ item.symbol }}",
1090
+ "price": "${{ item.price }}",
1091
+ "changePercent": "${{ item.changePercent }}",
1092
+ "marketCap": "${{ item.marketCap }}"
1093
+ }
1094
+ }
1095
+ ],
1096
+ "type": "yaml"
1097
+ },
1098
+ {
1099
+ "site": "xueqiu",
1100
+ "name": "watchlist",
1101
+ "description": "获取雪球自选股列表",
1102
+ "domain": "xueqiu.com",
1103
+ "strategy": "cookie",
1104
+ "browser": true,
1105
+ "args": [
1106
+ {
1107
+ "name": "category",
1108
+ "type": "str",
1109
+ "default": "1",
1110
+ "required": false,
1111
+ "help": "分类:1=自选(默认) 2=持仓 3=关注"
1112
+ },
1113
+ {
1114
+ "name": "limit",
1115
+ "type": "int",
1116
+ "default": 100,
1117
+ "required": false,
1118
+ "help": "默认 100"
1119
+ }
1120
+ ],
1121
+ "columns": [
1122
+ "symbol",
1123
+ "name",
1124
+ "price",
1125
+ "changePercent"
1126
+ ],
1127
+ "pipeline": [
1128
+ {
1129
+ "navigate": "https://xueqiu.com"
1130
+ },
1131
+ {
1132
+ "evaluate": "(async () => {\n const category = parseInt(${{ args.category | json }}) || 1;\n const resp = await fetch(`https://stock.xueqiu.com/v5/stock/portfolio/stock/list.json?size=100&category=${category}&pid=-1`, {credentials: 'include'});\n if (!resp.ok) throw new Error('HTTP ' + resp.status + ' Hint: Not logged in?');\n const d = await resp.json();\n if (!d.data || !d.data.stocks) throw new Error('获取失败,可能未登录');\n \n return d.data.stocks.map(s => ({\n symbol: s.symbol,\n name: s.name,\n price: s.current,\n change: s.chg,\n changePercent: s.percent != null ? s.percent.toFixed(2) + '%' : null,\n volume: s.volume,\n url: 'https://xueqiu.com/S/' + s.symbol\n }));\n})()\n"
1133
+ },
1134
+ {
1135
+ "map": {
1136
+ "symbol": "${{ item.symbol }}",
1137
+ "name": "${{ item.name }}",
1138
+ "price": "${{ item.price }}",
1139
+ "changePercent": "${{ item.changePercent }}"
1140
+ }
1141
+ },
1142
+ {
1143
+ "limit": "${{ args.limit }}"
1144
+ }
1145
+ ],
1146
+ "type": "yaml"
1147
+ },
1148
+ {
1149
+ "site": "yahoo-finance",
1150
+ "name": "quote",
1151
+ "description": "",
1152
+ "strategy": "cookie",
1153
+ "browser": true,
1154
+ "args": [],
1155
+ "type": "ts",
1156
+ "modulePath": "yahoo-finance/quote.js"
1157
+ },
1158
+ {
1159
+ "site": "youtube",
1160
+ "name": "search",
1161
+ "description": "",
1162
+ "strategy": "cookie",
1163
+ "browser": true,
1164
+ "args": [],
1165
+ "type": "ts",
1166
+ "modulePath": "youtube/search.js"
1167
+ },
1168
+ {
1169
+ "site": "zhihu",
1170
+ "name": "hot",
1171
+ "description": "知乎热榜",
1172
+ "domain": "www.zhihu.com",
1173
+ "strategy": "cookie",
1174
+ "browser": true,
1175
+ "args": [
1176
+ {
1177
+ "name": "limit",
1178
+ "type": "int",
1179
+ "default": 20,
1180
+ "required": false,
1181
+ "help": "Number of items to return"
1182
+ }
1183
+ ],
1184
+ "columns": [
1185
+ "rank",
1186
+ "title",
1187
+ "heat",
1188
+ "answers"
1189
+ ],
1190
+ "pipeline": [
1191
+ {
1192
+ "navigate": "https://www.zhihu.com"
1193
+ },
1194
+ {
1195
+ "evaluate": "(async () => {\n const res = await fetch('https://www.zhihu.com/api/v3/feed/topstory/hot-lists/total?limit=50', {\n credentials: 'include'\n });\n const text = await res.text();\n const d = JSON.parse(\n text.replace(/(\"id\"\\s*:\\s*)(\\d{16,})/g, '$1\"$2\"')\n );\n return (d?.data || []).map((item) => {\n const t = item.target || {};\n const questionId = t.id == null ? '' : String(t.id);\n return {\n title: t.title,\n url: 'https://www.zhihu.com/question/' + questionId,\n answer_count: t.answer_count,\n follower_count: t.follower_count,\n heat: item.detail_text || '',\n };\n });\n})()\n"
1196
+ },
1197
+ {
1198
+ "map": {
1199
+ "rank": "${{ index + 1 }}",
1200
+ "title": "${{ item.title }}",
1201
+ "heat": "${{ item.heat }}",
1202
+ "answers": "${{ item.answer_count }}",
1203
+ "url": "${{ item.url }}"
1204
+ }
1205
+ },
1206
+ {
1207
+ "limit": "${{ args.limit }}"
1208
+ }
1209
+ ],
1210
+ "type": "yaml"
1211
+ },
1212
+ {
1213
+ "site": "zhihu",
1214
+ "name": "question",
1215
+ "description": "",
1216
+ "strategy": "cookie",
1217
+ "browser": true,
1218
+ "args": [],
1219
+ "type": "ts",
1220
+ "modulePath": "zhihu/question.js"
1221
+ },
1222
+ {
1223
+ "site": "zhihu",
1224
+ "name": "search",
1225
+ "description": "知乎搜索",
1226
+ "domain": "www.zhihu.com",
1227
+ "strategy": "cookie",
1228
+ "browser": true,
1229
+ "args": [
1230
+ {
1231
+ "name": "keyword",
1232
+ "type": "str",
1233
+ "required": true,
1234
+ "help": "Search keyword"
1235
+ },
1236
+ {
1237
+ "name": "limit",
1238
+ "type": "int",
1239
+ "default": 10,
1240
+ "required": false,
1241
+ "help": "Number of results"
1242
+ }
1243
+ ],
1244
+ "columns": [
1245
+ "rank",
1246
+ "title",
1247
+ "type",
1248
+ "author",
1249
+ "votes"
1250
+ ],
1251
+ "pipeline": [
1252
+ {
1253
+ "navigate": "https://www.zhihu.com"
1254
+ },
1255
+ {
1256
+ "evaluate": "(async () => {\n const strip = (html) => (html || '').replace(/<[^>]+>/g, '').replace(/&nbsp;/g, ' ').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&amp;/g, '&').replace(/<em>/g, '').replace(/<\\/em>/g, '').trim();\n const keyword = ${{ args.keyword | json }};\n const limit = ${{ args.limit }};\n const res = await fetch('https://www.zhihu.com/api/v4/search_v3?q=' + encodeURIComponent(keyword) + '&t=general&offset=0&limit=' + limit, {\n credentials: 'include'\n });\n const d = await res.json();\n return (d?.data || [])\n .filter(item => item.type === 'search_result')\n .map(item => {\n const obj = item.object || {};\n const q = obj.question || {};\n return {\n type: obj.type,\n title: strip(obj.title || q.name || ''),\n excerpt: strip(obj.excerpt || '').substring(0, 100),\n author: obj.author?.name || '',\n votes: obj.voteup_count || 0,\n url: obj.type === 'answer'\n ? 'https://www.zhihu.com/question/' + q.id + '/answer/' + obj.id\n : obj.type === 'article'\n ? 'https://zhuanlan.zhihu.com/p/' + obj.id\n : 'https://www.zhihu.com/question/' + obj.id,\n };\n });\n})()\n"
1257
+ },
1258
+ {
1259
+ "map": {
1260
+ "rank": "${{ index + 1 }}",
1261
+ "title": "${{ item.title }}",
1262
+ "type": "${{ item.type }}",
1263
+ "author": "${{ item.author }}",
1264
+ "votes": "${{ item.votes }}"
1265
+ }
1266
+ },
1267
+ {
1268
+ "limit": "${{ args.limit }}"
1269
+ }
1270
+ ],
1271
+ "type": "yaml"
1272
+ }
1273
+ ]