forked from jackwener/OpenCLI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtop.yaml
More file actions
38 lines (29 loc) · 813 Bytes
/
top.yaml
File metadata and controls
38 lines (29 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
site: hackernews
name: top
description: Hacker News top stories
domain: news.ycombinator.com
strategy: public
browser: false
args:
limit:
type: int
default: 20
description: Number of stories
pipeline:
- fetch:
url: https://hacker-news.firebaseio.com/v0/topstories.json
- limit: "${{ Math.min((args.limit ? args.limit : 20) + 10, 50) }}"
- map:
id: ${{ item }}
- fetch:
url: https://hacker-news.firebaseio.com/v0/item/${{ item.id }}.json
- filter: item.title && !item.deleted && !item.dead
- map:
rank: ${{ index + 1 }}
title: ${{ item.title }}
score: ${{ item.score }}
author: ${{ item.by }}
comments: ${{ item.descendants }}
url: ${{ item.url }}
- limit: ${{ args.limit }}
columns: [rank, title, score, author, comments]