Permalink
Browse files

Create 2-all-versions-of-dist.pl

Not fully tested - and should be against api-v1
  • Loading branch information...
1 parent c51d807 commit c45eeb0cf55167046d27f5c112753e192b624264 @ranguard ranguard committed Jun 19, 2016
Showing with 33 additions and 0 deletions.
  1. +33 −0 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;
+
+
+

0 comments on commit c45eeb0

Please sign in to comment.