Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^5: Running JavaScript from within Perl (or just use the API)

by marto (Archbishop)
on Sep 22, 2019 at 02:17 UTC ( #11106534=note: print w/replies, xml ) Need Help??


in reply to Re^4: Running JavaScript from within Perl (or just use the API)
in thread Running JavaScript from within Perl

You've edited your site and the JSON now looks like:

{ "feeds": [ { "subscribe_URL": "https:\/\/the-art-of-autism.com\/feed\/", "feed_ID": "34259929", "meta": { "links": { "feed": "https:\/\/public-api.wordpress.com\/rest\/v1\/read\ +/feed\/34259929", "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/read\ +/sites\/57595012" } } }, { "subscribe_URL": "https:\/\/the-art-of-autism.com\/sample-page-2 +\/feed\/", "feed_ID": "", "meta": { "links": { } } }, { "subscribe_URL": "http:\/\/the-art-of-autism.com\/feed\/", "feed_ID": "34259929", "meta": { "links": { "feed": "https:\/\/public-api.wordpress.com\/rest\/v1\/read\ +/feed\/34259929", "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/read\ +/sites\/57595012" } } } ] }

Note Sample page 2 has no links. A fix for the code:

my $json = $ua->get( $url )->res->json; for my $feed ( @{$json->{feeds}} ){ if ( $feed->{meta}{links}{feed} ){ print "$feed->{meta}{links}{feed}\n"; } }

"which I couldn't figure out how to reply to directly" If viewing a node directly you'll see a link reading "Comment on {Node title here}", if viewing in thread mode you'll see a link titled "[reply]" at the bottom right of each reply.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11106534]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2019-10-17 17:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?