User Tools

Site Tools


plugins:extend_api

This is an old revision of the document!


Using the GetSimple API

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.

API Syntax

Extend ID based call:

http://get-simple.info/api/extend/?id=##

Replace ## with the ID of your plugin in our Extend repository. You can get your id by logging into Extend and viewing the particular file in question. Live example

Plugin Initial File based call: (plugins only)

http://get-simple.info/api/extend/?file=#####.php

Replace #####.php with the filename of your main plugin file. In order to use this call, your plugin needs to be packaged the correct way before uploaded into Extend. Live example

API Result Set

The result set for either call above sends back a json encoded string that looks like this:

{"status":"successful","id":"112","filename_id":"translate.php","name":"Translate","version":"0.3","category":"Plugin","tags":"translation, languages, internationalization, i18n","tested_with":"2.03","updated_date":"March 25, 2011","support_url":"http:\/\/get-simple.info\/forum\/topic\/1610\/translation-plugin\/","author_url":"http:\/\/mvlcek.bplaced.net","owner":"mvlcek","path":"http:\/\/get-simple.info\/extend\/plugin\/translate\/112\/","file":"http:\/\/get-simple.info\/extend\/export\/2902\/112\/translate.zip","downloads":"80","rating":""}

Since the result is in json format, you can turn the above into a PHP object array with json_decode($response). The resulting array will look like this:

stdClass Object
( 
  [author_url] => http=>//mvlcek.bplaced.net
  [category] => Plugin
  [downloads] => 80
  [file] => http=>//get-simple.info/extend/export/2902/112/translate.zip
  [filename_id] => translate.php
  [id] => 112
  [name] => Translate
  [owner] => mvlcek
  [path] => http=>//get-simple.info/extend/plugin/translate/112/
  [rating] => 
  [status] => successful
  [support_url] => http=>//get-simple.info/forum/topic/1610/translation-plugin/
  [tags] => translation, languages, internationalization, i18n
  [tested_with] => 2.03
  [updated_date] => March 25, 2011
  [version] => 0.3
)

PHP Example Code

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;

Extend API Limitations

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 this responsibly.

plugins/extend_api.1301429255.txt.gz · Last modified: 2013/04/19 14:57 (external edit)