Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions src/clis/v2ex/hot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: hot
description: V2EX 热门话题
domain: www.v2ex.com
strategy: public
browser: false
browser: true

args:
limit:
Expand All @@ -12,8 +12,22 @@ args:
description: Number of topics

pipeline:
- fetch:
url: https://www.v2ex.com/api/topics/hot.json
- navigate: https://www.v2ex.com/

- evaluate: |
(async () => {
const response = await fetch('/api/topics/hot.json', {
credentials: 'include',
headers: {
accept: 'application/json, text/plain, */*',
'x-requested-with': 'XMLHttpRequest',
},
});
if (!response.ok) {
throw new Error(`V2EX hot API request failed: ${response.status}`);
}
return await response.json();
})()

- map:
rank: ${{ index + 1 }}
Expand Down