use strict;
use warnings;
use Mojo::UserAgent;
my $filename = 'urls_Mojo.txt';
open(my $fh, '<:encoding(UTF-8)', $filename)
or die "Could not open file '$filename' $!";
my $y = 0; # input row count
while (my $row = <$fh>) {
$y++;
print $y;
print " $row";
my $url = $row;
# create a Mojo:UserAgent
my $ua = Mojo::UserAgent->new;
# use $ua to get the url and assign the value of 'subscriber_count' in the json
# to avariable, $subscribers
my $subscribers = $ua->get( $url )->result->json->{subscribers_count};
# print the variable to screen
print "Number of subscribers: $subscribers\n";
}
####
https://public-api.wordpress.com/rest/v1/read/feed/http%3A%2F%2Fthe-art-of-autism.com%2Ffeed
####
https://public-api.wordpress.com/rest/v1/read/feed/http%3A%2F%2Fthe-art-of-autism.com%2Ffeed
https://public-api.wordpress.com/rest/v1/read/feed/http%3A%2F%2Fanautismobserver.wordpress.com%2Ffeed