Skip to content

Commit 141ad66

Browse files
authored
Merge pull request #25 from zmughal/rev-deps-new-endpoint
Update reverse dependencies examples
2 parents 9ef1716 + 26b4f5b commit 141ad66

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

scripts/search/reverse_dependencies/by-dist-www-mech.pl renamed to scripts/reverse_dependencies/by-dist-www-mech.pl

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
my $mech = WWW::Mechanize::GZip->new;
1111

1212
$mech->get(
13-
"https://fastapi.metacpan.org/v1/search/reverse_dependencies/carton");
13+
"https://fastapi.metacpan.org/v1/reverse_dependencies/dist/Carton");
1414

1515
my $results = decode_json( $mech->content );
1616

1717
my @dists
18-
= map { $_->{_source}->{distribution} } @{ $results->{hits}->{hits} };
18+
= map { $_->{distribution} } @{ $results->{data} };
1919
p @dists;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env perl
2+
3+
use strict;
4+
use warnings;
5+
6+
use Data::Printer;
7+
use JSON::MaybeXS qw( decode_json );
8+
use WWW::Mechanize::GZip ();
9+
10+
my $mech = WWW::Mechanize::GZip->new;
11+
12+
$mech->get(
13+
"https://fastapi.metacpan.org/v1/reverse_dependencies/module/WWW::Mechanize"
14+
);
15+
16+
my $results = decode_json( $mech->content );
17+
18+
my @dists
19+
= map { $_->{distribution} } @{ $results->{data} };
20+
p @dists;

scripts/search/reverse_dependencies/by-release-version-mech.pl

-20
This file was deleted.

0 commit comments

Comments
 (0)