[wp-hackers] Accessing Update Check API Outside of WordPress

chris mccoy chris at lod.com
Mon Nov 19 13:09:42 UTC 2012


You could prob use sed/awk, I used that for a shell script I wrote to
install wp by specifying the version, if not get the current version.

Here are two diff ways I used.

            wp_current_version=`curl -s
http://api.wordpress.org/core/version-check/1.6/ | awk -F\" '{print $34}'`
            wp_current_version=`curl -s
http://api.wordpress.org/core/version-check/1.6/ | sed -e
's/.*s:7:"current";s:5:"//;s/".*//'`

of course this is just for wp version not plugin, but you get the idea.

-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of David Anderson
Sent: November 19, 2012 7:25 AM
To: wp-hackers at lists.automattic.com
Subject: Re: [wp-hackers] Accessing Update Check API Outside of WordPress

> If you use the/info/  endpoint for a single plugin, you'll end up with 
> the current version. The update-check endpoints are designed for 
> checking a bunch of plugins en masse, and for when you may not know 
> the actual slug of the plugin. (It does some fairly complex matching 
> using pretty much every plugin header to make sure it finds the right 
> plugin.)
>
> Example:http://api.wordpress.org/plugins/info/1.0/debug-bar.json. 
> Other accepted formats include .xml and .php.

Do you think there's any possibility that .ini could be provided? PHP
serialized, JSON and XML are all nasty to try to process from shell, which
is what I'm doing. (I chose shell because of its portability across the
POSIX world). Presently I have a dependency on PHP, and some hacky
fall-backs if it's not available, which works for all my customers so far,
but it could be much improved. I realise that there are external tools I
could call out to to do the processing, but that loses the portability. I'd
like something I can process reasonably elegantly from Bash.

David

--
WordShell - WordPress fast from the CLI - www.wordshell.net

_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list