Is there a way to interact with WordPress?

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
tsolignani
Posts: 187
Joined: 12 Jan 2019 11:53
Location: Vignola, Mo, Italy
Contact:

Is there a way to interact with WordPress?

Post by tsolignani » 01 Jan 2020 14:43

Let's say I would like to interact with a self hosted WordPress blog, to, f.i., retrieve categories, tags, number of pending post, publish a draft or pending, view comments and so on, with automagic.

I had a look at autoweb plugin, but it does not support WordPress API.

Do you know if there is some other plugin which does it?

Or any other way to automate a WordPress blog, say via cli and ssh or else?

Thank you.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Is there a way to interact with WordPress?

Post by Desmanto » 01 Jan 2020 17:54

Wordpress has the API, but it seems no android app utilize it yet. You can use action HTTP request and follow the API guideline to create your own.
Example to query categories : http://demo.wp-api.org/wp-json/wp/v2/categories

You can build your own list of query, documentation of the API is here : https://developer.wordpress.org/rest-api/reference/

The result is in JSON, which then you can use fromJSON() to convert it into object that can be parsed later using script in Automagic. You can search and look on several example of JSON parsing in the forum. Or if you got stuck, you can always try to post an example (just use the demo site above) and explain what you need.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
tsolignani
Posts: 187
Joined: 12 Jan 2019 11:53
Location: Vignola, Mo, Italy
Contact:

Re: Is there a way to interact with WordPress?

Post by tsolignani » 03 Jan 2020 14:33

Thank you!

That could really do the trick.

I'll try to work on it a bit.

Thanks again.

Post Reply