Files
opencli/src/clis/hackernews/top.yaml
T

37 lines
702 B
YAML

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: 30
- map:
id: ${{ item }}
- fetch:
url: https://hacker-news.firebaseio.com/v0/item/${{ item.id }}.json
- 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]