Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by anautismobserver (Sexton)
on Sep 13, 2019 at 19:38 UTC ( [id://11106141]=note: print w/replies, xml ) Need Help??


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

I tried following the A Beginners’s Guide to the WordPress REST API tutorial

It didn't work for my own (free) WordPress account, but when I used the "the-art-of-autism.com" (a premium account on which I have admin privileges) in place of "yourdomain.com" I was able to follow the tutorial successfully.

However, none of the Routes or Endpoints seem to give me what I want, which is the number of followers for an arbitrary WordPress account on which I don't have admin privileges. I'm encouraged by the REST API Handbook Reference page stating "The REST API provides public data accessible to any client anonymously, as well as private data only available after authentication."

I can't find any way to determine the number of followers, or what public data is accessible anonymously. Can you help with either of those? Thanks.

  • Comment on Re^2: Running JavaScript from within Perl (or just use the API)

Replies are listed 'Best First'.
Re^3: Running JavaScript from within Perl (or just use the API)
by Corion (Patriarch) on Sep 13, 2019 at 19:47 UTC

    It seems that the URL to use is

    https://developer.wordpress.com/docs/api/1.1/get/sites/$site/stats/fol +lowers/

    ... but you need to be authenticated:

    curl "https://public-api.wordpress.com/rest/v1.1/sites/the-art-of-auti +sm.com/stats/followers" {"error":"unauthorized","message":"user cannot view stats"}

    So, you will either have to get permission by the respective sites or you will have to continue scraping the websites.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (7)
As of 2024-04-23 10:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found