This is an old revision of the document!
With the creation of GetSimple Extend comes a new API that allows developers the ability to grab vital statistics from your Extend profile and integrate them into your site or plugin. For example, A plugin developer can now code their plugin to look at our API and automatically determine if there is an update available or not.
http://get-simple.info/api/extend/?id=##
Replace ## with the ID of your plugin in our repository. You can get your id by logging into Extend and viewing your files.
The API sends back a json encoded string that looks like this:
{"status":"successful","id":"30","name":"Cardinal","version":"1.0","downloads":"4", "category":"Theme","path":"http:\/\/get-simple.info\/extend\/theme\/cardinal\/30\/", "file":"http:\/\/get-simple.info\/extend\/download.php?file=files\/2\/cardinal.zip&id=30", "owner":"ccagle8","tags":"cardinal, red, two column"}
Since this is json, you can turn the above into a PHP array with json_decode($response). The resulting array will look like this:
stdClass Object ( [status] => successful [id] => 30 [name] => Cardinal [version] => 1.0 [downloads] => 2 [category] => Theme [path] => http://get-simple.info/extend/theme/cardinal/30/ [file] => http://get-simple.info/extend/download.php?file=files/2/cardinal.zip&id=30 [owner] => ccagle8, [tags] => cardinal, red, two column )
This will echo out the latest version number for the live example above.
$my_plugin_id = 30; // replace this with yours $apiback = file_get_contents('http://get-simple.info/api/extend/?id='.$my_plugin_id); $response = json_decode($apiback); if ($response->status == 'successful') { // Successful api response sent back. $current_ver = $response->version; } echo $current_ver;
This API is only refreshed every 4 hours. This is to limit the server load for a service that does not need to be checked any more frequently than that. Please use responsibly.