@@ -1249,10 +1249,7 @@ sub _show_Changes
1249
1249
next unless eval { $module -> inst_file };
1250
1250
# next if $module->uptodate;
1251
1251
1252
- ( my $id = $module -> id() ) =~ s / ::/ \- / ;
1253
-
1254
- my $url = " http://search.cpan.org/~" . lc ( $module -> userid ) . " /" .
1255
- $id . " -" . $module -> cpan_version() . " /" ;
1252
+ my $url = " https://fastapi.metacpan.org/v1/module/" . $module -> id();
1256
1253
1257
1254
# print "URL: $url\n";
1258
1255
_get_changes_file($url );
@@ -1263,21 +1260,21 @@ sub _show_Changes
1263
1260
1264
1261
sub _get_changes_file
1265
1262
{
1266
- croak " Reading Changes files requires LWP::Simple and URI\n "
1267
- unless _safe_load_module(" LWP::Simple" ) && _safe_load_module(" URI" );
1263
+ croak " Reading Changes files requires LWP::Simple, LWP::Protocol::https, JSON::PP\n "
1264
+ unless _safe_load_module(" LWP::Simple" ) && _safe_load_module(" LWP::Protocol::https" )
1265
+ && _safe_load_module(" JSON::PP" );
1268
1266
1269
1267
my $url = shift ;
1270
1268
1271
1269
my $content = LWP::Simple::get( $url );
1272
1270
$logger -> info( " Got $url ..." ) if defined $content ;
1273
1271
# print $content;
1274
1272
1275
- my ( $change_link ) = $content =~ m | <a href="(.*?)">Changes</a>| gi ;
1276
-
1277
- my $changes_url = URI-> new_abs( $change_link , $url );
1273
+ my $distribution = JSON::PP::decode_json( $content )-> {distribution };
1274
+ my $changes_url = " https://fastapi.metacpan.org/v1/changes/$distribution " ;
1278
1275
$logger -> debug( " Change link is: $changes_url " );
1279
1276
1280
- my $changes = LWP::Simple::get( $changes_url );
1277
+ my $changes = JSON::PP::decode_json( LWP::Simple::get( $changes_url ) ) -> { content } ;
1281
1278
1282
1279
print $changes ;
1283
1280
0 commit comments