我使用atmospherejs.com搜索包,但不幸的是,它没有提供任何标准来对结果进行排序:例如,如果我想按下载数量排序。
是否有一个查询结果排序的一些标准:下载数量,评级,新的软件包等。
谢谢
发布于 2015-10-17 18:55:25
我不这么认为,但您可以使用API获取原始数据,然后过滤和排序:
# get raw data
curl --header "Accept: application/json" https://atmospherejs.com/a/packages > /tmp/all.json
# process the json array in whatever way you want, for instance here
# only consider packages starting with an "f", then sort by installs per year
node -e "x = require('/tmp/all.json'); \
console.log(x.filter(function(a) { return a.name[0] == 'f'; })\
.sort(function(a,b) { return a['installs-per-year'] < b['installs-per-year']; }));"https://stackoverflow.com/questions/33190052
复制相似问题