in reply to Re^2: Running JavaScript from within Perl (or just use the API)
in thread Running JavaScript from within Perl
The following code works to assign $subscribers to subscribers_count, but gives an error "Use of uninitialized value $feedurl in print" for the assignment of $feedurl.
use strict; use warnings; use Mojo::UserAgent; my $url = 'https://public-api.wordpress.com/rest/v1/read/feed/34259929'; my $ua = Mojo::UserAgent->new; my $subscribers = $ua->get($url)->result->json->{subscribers_count}; print "Number of subscribers: $subscribers\n"; my $feedurl = $ua->get( $url )->result->json->{'meta.links.self'}; print $feedurl;
Pleae tell me what I'm doing wrong. Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Running JavaScript from within Perl (or just use the API)
by hippo (Archbishop) on Sep 21, 2019 at 22:14 UTC | |
by anautismobserver (Sexton) on Sep 23, 2019 at 19:11 UTC | |
by haukex (Archbishop) on Sep 23, 2019 at 22:44 UTC | |
by anautismobserver (Sexton) on Sep 24, 2019 at 17:16 UTC | |
by marto (Cardinal) on Sep 24, 2019 at 18:35 UTC |