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

David Anderson david at wordshell.net
Tue Nov 20 13:11:57 UTC 2012


On 20/11/12 16:00, David Anderson wrote:
>
> JSON is similar, but less complex and easier to write a parser for, 
> but still a long job. I hadn't realised that api.wordpress.org output 
> JSON until Andrew mentioned it yesterday - I'd only know of the 
> serialized and XML. Now I've Googled, it seems that there is a 
> MIT-licensed pure-shell parser for JSON, here which I'm about to 
> investigate: https://github.com/dominictarr/JSON.sh. Looks promising.
>

In case anyone else is interested, it's a clever bit of work - and 
suprisingly compact. Very awk-able:

# curl -s 
http://api.wordpress.org/plugins/info/1.0/add-email-signature.json | 
./JSON.sh | head
["name"]        "Add Email Signature"
["slug"]        "add-email-signature"
["version"]     "1.0.2"
["author"]      "<a href=\"http:\/\/david.dw-perspective.org.uk\">David 
Anderson<\/a>"
["author_profile"] "http:\/\/profiles.wordpress.org\/davidanderson"
["contributors","David Anderson"] 
"http:\/\/profiles.wordpress.org\/davidanderson"
["contributors"]        {"David 
Anderson":"http:\/\/profiles.wordpress.org\/davidanderson"}
["requires"]    "3.2"
["tested"]      "3.5"
["compatibility","3.4.2","1.0",0]       100


David

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



More information about the wp-hackers mailing list