From c45eeb0cf55167046d27f5c112753e192b624264 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 19 Jun 2016 20:08:23 +0100 Subject: [PATCH] Create 2-all-versions-of-dist.pl Not fully tested - and should be against api-v1 --- .../distribution/2-all-versions-of-dist.pl | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 scripts/endpoints/distribution/2-all-versions-of-dist.pl diff --git a/scripts/endpoints/distribution/2-all-versions-of-dist.pl b/scripts/endpoints/distribution/2-all-versions-of-dist.pl new file mode 100644 index 0000000..2a31159 --- /dev/null +++ b/scripts/endpoints/distribution/2-all-versions-of-dist.pl @@ -0,0 +1,33 @@ +#!/usr/bin/env perl + +use strict; +use warnings; + +use Data::Printer; +use MetaCPAN::Util qw( es ); + +my $dist = $ARGV[0] + +my $releases = es()->get( + index => 'v1', + type => 'release', + body => + { + query => { + filtered => { + query => { match_all => {} }, + filter => { term => { distribution => $dist } } + } + }, + size => 1000, + sort => [ { date => 'desc' } ], + fields => + [qw( download_url name date author version version_numified + status maturity authorized )], + } +); + +p $releases; + + +